diff options
Diffstat (limited to 'llvm/lib/Linker/LinkModules.cpp')
-rw-r--r-- | llvm/lib/Linker/LinkModules.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp index 403a1ff90c5..2692ec97b78 100644 --- a/llvm/lib/Linker/LinkModules.cpp +++ b/llvm/lib/Linker/LinkModules.cpp @@ -1052,9 +1052,8 @@ bool ModuleLinker::linkGlobalProto(GlobalVariable *SGV) { if (GlobalVariable *DGVar = dyn_cast<GlobalVariable>(DGV)) { DGVar->setAlignment(Alignment); - if (DGVar->isDeclaration() && SGV->isConstant() && - !DGVar->isConstant()) - DGVar->setConstant(true); + if (DGVar->isDeclaration() && !SGV->isConstant()) + DGVar->setConstant(false); } // Set calculated linkage, visibility and unnamed_addr. |