diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2015-01-31 19:28:59 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2015-01-31 19:28:59 +0000 |
| commit | 9e435806aaf5bd7e974d317ef247f200200ad686 (patch) | |
| tree | 950414edc74ebec2c62ac1b5fd10e799f0204b5b /lib/CodeGen/ItaniumCXXABI.cpp | |
| parent | 06d4ba388873e6d1cfa9cd715a8935ecc8cd2097 (diff) | |
Notes
Diffstat (limited to 'lib/CodeGen/ItaniumCXXABI.cpp')
| -rw-r--r-- | lib/CodeGen/ItaniumCXXABI.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/CodeGen/ItaniumCXXABI.cpp b/lib/CodeGen/ItaniumCXXABI.cpp index f2ffabcf3e9d..deebab858399 100644 --- a/lib/CodeGen/ItaniumCXXABI.cpp +++ b/lib/CodeGen/ItaniumCXXABI.cpp @@ -1711,12 +1711,11 @@ void ItaniumCXXABI::EmitGuardedInit(CodeGenFunction &CGF, // The ABI says: It is suggested that it be emitted in the same COMDAT group // as the associated data object - llvm::Comdat *C = var->getComdat(); - if (!D.isLocalVarDecl() && C) { + if (!D.isLocalVarDecl() && var->isWeakForLinker() && CGM.supportsCOMDAT()) { + llvm::Comdat *C = CGM.getModule().getOrInsertComdat(var->getName()); guard->setComdat(C); + var->setComdat(C); CGF.CurFn->setComdat(C); - } else if (CGM.supportsCOMDAT() && guard->isWeakForLinker()) { - guard->setComdat(CGM.getModule().getOrInsertComdat(guard->getName())); } CGM.setStaticLocalDeclGuardAddress(&D, guard); |
