diff options
Diffstat (limited to 'llvm/lib/IR/Globals.cpp')
| -rw-r--r-- | llvm/lib/IR/Globals.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/IR/Globals.cpp b/llvm/lib/IR/Globals.cpp index da3b02a0fa6..8c28ec176f6 100644 --- a/llvm/lib/IR/Globals.cpp +++ b/llvm/lib/IR/Globals.cpp @@ -99,6 +99,7 @@ GlobalVariable::GlobalVariable(Type *Ty, bool constant, LinkageTypes Link, } LeakDetector::addGarbageObject(this); + setAddressMaybeTaken(true); } GlobalVariable::GlobalVariable(Module &M, Type *Ty, bool constant, @@ -125,6 +126,7 @@ GlobalVariable::GlobalVariable(Module &M, Type *Ty, bool constant, Before->getParent()->getGlobalList().insert(Before, this); else M.getGlobalList().push_back(this); + setAddressMaybeTaken(true); } void GlobalVariable::setParent(Module *parent) { @@ -185,6 +187,7 @@ void GlobalVariable::copyAttributesFrom(const GlobalValue *Src) { GlobalValue::copyAttributesFrom(Src); const GlobalVariable *SrcVar = cast<GlobalVariable>(Src); setThreadLocal(SrcVar->isThreadLocal()); + setAddressMaybeTaken(SrcVar->AddressMaybeTaken()); } |

