mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-07 11:26:02 +03:00
Use IRState parameter instead of gIR where available.
This commit is contained in:
parent
1242be25d0
commit
60f385b062
1 changed files with 3 additions and 3 deletions
|
@ -217,7 +217,7 @@ void VarDeclaration::codegen(IRState *p)
|
||||||
if (initVal->getType() != gvar->getType()->getElementType())
|
if (initVal->getType() != gvar->getType()->getElementType())
|
||||||
{
|
{
|
||||||
llvm::GlobalVariable* newGvar = getOrCreateGlobal(loc,
|
llvm::GlobalVariable* newGvar = getOrCreateGlobal(loc,
|
||||||
*gIR->module, initVal->getType(), gvar->isConstant(),
|
*p->module, initVal->getType(), gvar->isConstant(),
|
||||||
llLinkage, 0,
|
llLinkage, 0,
|
||||||
"", // We take on the name of the old global below.
|
"", // We take on the name of the old global below.
|
||||||
gvar->isThreadLocal());
|
gvar->isThreadLocal());
|
||||||
|
@ -241,14 +241,14 @@ void VarDeclaration::codegen(IRState *p)
|
||||||
gvar->setLinkage(llLinkage);
|
gvar->setLinkage(llLinkage);
|
||||||
|
|
||||||
// Also set up the edbug info.
|
// Also set up the edbug info.
|
||||||
gIR->DBuilder.EmitGlobalVariable(gvar, this);
|
p->DBuilder.EmitGlobalVariable(gvar, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If this global is used from a naked function, we need to create an
|
// If this global is used from a naked function, we need to create an
|
||||||
// artificial "use" for it, or it could be removed by the optimizer if
|
// artificial "use" for it, or it could be removed by the optimizer if
|
||||||
// the only reference to it is in inline asm.
|
// the only reference to it is in inline asm.
|
||||||
if (nakedUse)
|
if (nakedUse)
|
||||||
gIR->usedArray.push_back(DtoBitCast(gvar, getVoidPtrType()));
|
p->usedArray.push_back(DtoBitCast(gvar, getVoidPtrType()));
|
||||||
|
|
||||||
if (Logger::enabled())
|
if (Logger::enabled())
|
||||||
Logger::cout() << *gvar << '\n';
|
Logger::cout() << *gvar << '\n';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue