mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-07 11:26:02 +03:00
Fix a typo in variable name
This commit is contained in:
parent
bdd346c3ae
commit
f4e2d8486b
1 changed files with 8 additions and 8 deletions
|
@ -340,13 +340,13 @@ static LLFunction* build_module_reference_and_ctor(LLConstant* moduleinfo)
|
||||||
///
|
///
|
||||||
/// Pseudocode:
|
/// Pseudocode:
|
||||||
/// if (dsoInitialized == executeWhenInitialized) {
|
/// if (dsoInitialized == executeWhenInitialized) {
|
||||||
/// dsoInitiaized = !executeWhenInitialized;
|
/// dsoInitialized = !executeWhenInitialized;
|
||||||
/// auto record = {1, dsoSlot, minfoBeg, minfoEnd, minfoUsedPointer};
|
/// auto record = {1, dsoSlot, minfoBeg, minfoEnd, minfoUsedPointer};
|
||||||
/// _d_dso_registry(cast(CompilerDSOData*)&record);
|
/// _d_dso_registry(cast(CompilerDSOData*)&record);
|
||||||
/// }
|
/// }
|
||||||
static void build_dso_ctor_dtor_body(
|
static void build_dso_ctor_dtor_body(
|
||||||
llvm::Function* targetFunc,
|
llvm::Function* targetFunc,
|
||||||
llvm::Value* dsoInitiaized,
|
llvm::Value* dsoInitialized,
|
||||||
llvm::Value* dsoSlot,
|
llvm::Value* dsoSlot,
|
||||||
llvm::Value* minfoBeg,
|
llvm::Value* minfoBeg,
|
||||||
llvm::Value* minfoEnd,
|
llvm::Value* minfoEnd,
|
||||||
|
@ -368,13 +368,13 @@ static void build_dso_ctor_dtor_body(
|
||||||
IRBuilder<> b(entryBB);
|
IRBuilder<> b(entryBB);
|
||||||
llvm::Value* condEval = b.CreateICmp(executeWhenInitialized ? llvm::ICmpInst::ICMP_NE
|
llvm::Value* condEval = b.CreateICmp(executeWhenInitialized ? llvm::ICmpInst::ICMP_NE
|
||||||
: llvm::ICmpInst::ICMP_EQ,
|
: llvm::ICmpInst::ICMP_EQ,
|
||||||
b.CreateLoad(dsoInitiaized),
|
b.CreateLoad(dsoInitialized),
|
||||||
b.getInt8(0));
|
b.getInt8(0));
|
||||||
b.CreateCondBr(condEval, initBB, endBB);
|
b.CreateCondBr(condEval, initBB, endBB);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
IRBuilder<> b(initBB);
|
IRBuilder<> b(initBB);
|
||||||
b.CreateStore(b.getInt8(!executeWhenInitialized), dsoInitiaized);
|
b.CreateStore(b.getInt8(!executeWhenInitialized), dsoInitialized);
|
||||||
|
|
||||||
llvm::Constant* version = DtoConstSize_t(1);
|
llvm::Constant* version = DtoConstSize_t(1);
|
||||||
llvm::Type* memberTypes[] = {
|
llvm::Type* memberTypes[] = {
|
||||||
|
@ -488,7 +488,7 @@ static void build_dso_registry_calls(llvm::Constant* thisModuleInfo)
|
||||||
// problems. This would mean that it is no longer safe to link D objects
|
// problems. This would mean that it is no longer safe to link D objects
|
||||||
// directly using e.g. "g++ dcode.o cppcode.o", though.
|
// directly using e.g. "g++ dcode.o cppcode.o", though.
|
||||||
|
|
||||||
llvm::GlobalVariable* dsoInitiaized = new llvm::GlobalVariable(
|
llvm::GlobalVariable* dsoInitialized = new llvm::GlobalVariable(
|
||||||
*gIR->module,
|
*gIR->module,
|
||||||
llvm::Type::getInt8Ty(gIR->context()),
|
llvm::Type::getInt8Ty(gIR->context()),
|
||||||
false,
|
false,
|
||||||
|
@ -496,7 +496,7 @@ static void build_dso_registry_calls(llvm::Constant* thisModuleInfo)
|
||||||
llvm::ConstantInt::get(llvm::Type::getInt8Ty(gIR->context()), 0),
|
llvm::ConstantInt::get(llvm::Type::getInt8Ty(gIR->context()), 0),
|
||||||
"ldc.dso_initialized"
|
"ldc.dso_initialized"
|
||||||
);
|
);
|
||||||
dsoInitiaized->setVisibility(llvm::GlobalValue::HiddenVisibility);
|
dsoInitialized->setVisibility(llvm::GlobalValue::HiddenVisibility);
|
||||||
|
|
||||||
// There is no reason for this cast to void*, other than that removing it
|
// There is no reason for this cast to void*, other than that removing it
|
||||||
// seems to trigger a bug in the llvm::Linker (at least on LLVM 3.4)
|
// seems to trigger a bug in the llvm::Linker (at least on LLVM 3.4)
|
||||||
|
@ -514,7 +514,7 @@ static void build_dso_registry_calls(llvm::Constant* thisModuleInfo)
|
||||||
gIR->module
|
gIR->module
|
||||||
);
|
);
|
||||||
dsoCtor->setVisibility(llvm::GlobalValue::HiddenVisibility);
|
dsoCtor->setVisibility(llvm::GlobalValue::HiddenVisibility);
|
||||||
build_dso_ctor_dtor_body(dsoCtor, dsoInitiaized, dsoSlot, minfoBeg, minfoEnd, minfoRefPtr, false);
|
build_dso_ctor_dtor_body(dsoCtor, dsoInitialized, dsoSlot, minfoBeg, minfoEnd, minfoRefPtr, false);
|
||||||
llvm::appendToGlobalCtors(*gIR->module, dsoCtor, 65535);
|
llvm::appendToGlobalCtors(*gIR->module, dsoCtor, 65535);
|
||||||
|
|
||||||
llvm::Function* dsoDtor = llvm::Function::Create(
|
llvm::Function* dsoDtor = llvm::Function::Create(
|
||||||
|
@ -524,7 +524,7 @@ static void build_dso_registry_calls(llvm::Constant* thisModuleInfo)
|
||||||
gIR->module
|
gIR->module
|
||||||
);
|
);
|
||||||
dsoDtor->setVisibility(llvm::GlobalValue::HiddenVisibility);
|
dsoDtor->setVisibility(llvm::GlobalValue::HiddenVisibility);
|
||||||
build_dso_ctor_dtor_body(dsoDtor, dsoInitiaized, dsoSlot, minfoBeg, minfoEnd, minfoRefPtr, true);
|
build_dso_ctor_dtor_body(dsoDtor, dsoInitialized, dsoSlot, minfoBeg, minfoEnd, minfoRefPtr, true);
|
||||||
llvm::appendToGlobalDtors(*gIR->module, dsoDtor, 65535);
|
llvm::appendToGlobalDtors(*gIR->module, dsoDtor, 65535);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue