mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-04-30 23:20:40 +03:00
codegenerator: Remove unused code, add some doc comments [nfc]
This commit is contained in:
parent
48fc385017
commit
610edb9659
1 changed files with 3 additions and 17 deletions
|
@ -19,25 +19,11 @@
|
||||||
|
|
||||||
void codegenModule(IRState *irs, Module *m, bool emitFullModuleInfo);
|
void codegenModule(IRState *irs, Module *m, bool emitFullModuleInfo);
|
||||||
|
|
||||||
|
/// The module with the frontend-generated C main() definition.
|
||||||
extern Module *g_entrypointModule;
|
extern Module *g_entrypointModule;
|
||||||
extern Module *g_dMainModule;
|
|
||||||
|
|
||||||
namespace {
|
/// The module that contains the actual D main() (_Dmain) definition.
|
||||||
/// Emits a declaration for the given symbol, which is assumed to be of type
|
extern Module *g_dMainModule;
|
||||||
/// i8*, and defines a second globally visible i8* that contains the address
|
|
||||||
/// of the first symbol.
|
|
||||||
void emitSymbolAddrGlobal(llvm::Module &lm, const char *symbolName,
|
|
||||||
const char *addrName) {
|
|
||||||
llvm::Type *voidPtr =
|
|
||||||
llvm::PointerType::get(llvm::Type::getInt8Ty(lm.getContext()), 0);
|
|
||||||
auto targetSymbol = new llvm::GlobalVariable(
|
|
||||||
lm, voidPtr, false, llvm::GlobalValue::ExternalWeakLinkage, nullptr,
|
|
||||||
symbolName);
|
|
||||||
new llvm::GlobalVariable(
|
|
||||||
lm, voidPtr, false, llvm::GlobalValue::ExternalLinkage,
|
|
||||||
llvm::ConstantExpr::getBitCast(targetSymbol, voidPtr), addrName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace ldc {
|
namespace ldc {
|
||||||
CodeGenerator::CodeGenerator(llvm::LLVMContext &context, bool singleObj)
|
CodeGenerator::CodeGenerator(llvm::LLVMContext &context, bool singleObj)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue