diff options
Diffstat (limited to 'llvm/lib/IR/Globals.cpp')
-rw-r--r-- | llvm/lib/IR/Globals.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/IR/Globals.cpp b/llvm/lib/IR/Globals.cpp index 7e8ef6526fc..3bf3cc25455 100644 --- a/llvm/lib/IR/Globals.cpp +++ b/llvm/lib/IR/Globals.cpp @@ -96,6 +96,7 @@ void GlobalObject::copyAttributesFrom(const GlobalValue *Src) { if (const auto *GV = dyn_cast<GlobalObject>(Src)) { setAlignment(GV->getAlignment()); setSection(GV->getSection()); + setComdat(const_cast<GlobalObject *>(GV)->getComdat()); } } |