[llvm-branch-commits] [cfe-branch] r226699 - Revert r225705 from the branch.
Rafael Espindola
rafael.espindola at gmail.com
Wed Jan 21 12:37:19 PST 2015
Author: rafael
Date: Wed Jan 21 14:37:18 2015
New Revision: 226699
URL: http://llvm.org/viewvc/llvm-project?rev=226699&view=rev
Log:
Revert r225705 from the branch.
There were a few followup commits to this one, but only this one made it to
the branch.
Also, there are still some open issues (pr22285), so it is probably better
to leave this out of 3.6.
original message:
--------------------------------------------------------------------------
[patch][pr19848] Produce explicit comdats in clang.
The llvm IR until recently had no support for comdats. This was a problem when
targeting C++ on ELF/COFF as just using weak linkage would cause quite a bit of
dead bits to remain on the executable (unless -ffunction-sections,
-fdata-sections and --gc-sections were used).
To fix the problem, llvm's codegen will just assume that any weak or linkonce
that is not in an explicit comdat should be output in one with the same name as
the global.
This unfortunately breaks cases like pr19848 where a weak symbol is not
xpected to be part of any comdat.
Now that we have explicit comdats in the IR, we can finally get both cases
right.
This first patch just makes clang give explicit comdats to GlobalValues where
t is allowed to.
A followup patch to llvm will then stop implicitly producing comdats.
------------------------------------------------------------------------
Modified:
cfe/branches/release_36/lib/CodeGen/CGDecl.cpp
cfe/branches/release_36/lib/CodeGen/CGDeclCXX.cpp
cfe/branches/release_36/lib/CodeGen/CodeGenModule.cpp
cfe/branches/release_36/lib/CodeGen/ItaniumCXXABI.cpp
cfe/branches/release_36/lib/CodeGen/MicrosoftCXXABI.cpp
cfe/branches/release_36/test/CodeGen/ms-declspecs.c
cfe/branches/release_36/test/CodeGenCXX/cxx11-exception-spec.cpp
cfe/branches/release_36/test/CodeGenCXX/dllexport-members.cpp
cfe/branches/release_36/test/CodeGenCXX/dllexport.cpp
cfe/branches/release_36/test/CodeGenCXX/dllimport.cpp
cfe/branches/release_36/test/CodeGenCXX/ms-integer-static-data-members-exported.cpp
cfe/branches/release_36/test/CodeGenCXX/ms-integer-static-data-members.cpp
cfe/branches/release_36/test/CodeGenCXX/split-stacks.cpp
cfe/branches/release_36/test/CodeGenCXX/static-init.cpp
Modified: cfe/branches/release_36/lib/CodeGen/CGDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_36/lib/CodeGen/CGDecl.cpp?rev=226699&r1=226698&r2=226699&view=diff
==============================================================================
--- cfe/branches/release_36/lib/CodeGen/CGDecl.cpp (original)
+++ cfe/branches/release_36/lib/CodeGen/CGDecl.cpp Wed Jan 21 14:37:18 2015
@@ -206,9 +206,6 @@ llvm::Constant *CodeGenModule::getOrCrea
GV->setAlignment(getContext().getDeclAlign(&D).getQuantity());
setGlobalVisibility(GV, &D);
- if (supportsCOMDAT() && GV->isWeakForLinker())
- GV->setComdat(TheModule.getOrInsertComdat(GV->getName()));
-
if (D.getTLSKind())
setTLSMode(GV, D);
Modified: cfe/branches/release_36/lib/CodeGen/CGDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_36/lib/CodeGen/CGDeclCXX.cpp?rev=226699&r1=226698&r2=226699&view=diff
==============================================================================
--- cfe/branches/release_36/lib/CodeGen/CGDeclCXX.cpp (original)
+++ cfe/branches/release_36/lib/CodeGen/CGDeclCXX.cpp Wed Jan 21 14:37:18 2015
@@ -267,7 +267,15 @@ void CodeGenModule::EmitPointerToInitFun
addUsedGlobal(PtrArray);
// If the GV is already in a comdat group, then we have to join it.
- if (llvm::Comdat *C = GV->getComdat())
+ llvm::Comdat *C = GV->getComdat();
+
+ // LinkOnce and Weak linkage are lowered down to a single-member comdat group.
+ // Make an explicit group so we can join it.
+ if (!C && (GV->hasWeakLinkage() || GV->hasLinkOnceLinkage())) {
+ C = TheModule.getOrInsertComdat(GV->getName());
+ GV->setComdat(C);
+ }
+ if (C)
PtrArray->setComdat(C);
}
Modified: cfe/branches/release_36/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_36/lib/CodeGen/CodeGenModule.cpp?rev=226699&r1=226698&r2=226699&view=diff
==============================================================================
--- cfe/branches/release_36/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/branches/release_36/lib/CodeGen/CodeGenModule.cpp Wed Jan 21 14:37:18 2015
@@ -1928,31 +1928,6 @@ void CodeGenModule::MaybeHandleStaticInE
R.first->second = nullptr;
}
-static bool shouldBeInCOMDAT(CodeGenModule &CGM, const Decl &D) {
- if (!CGM.supportsCOMDAT())
- return false;
-
- if (D.hasAttr<SelectAnyAttr>())
- return true;
-
- GVALinkage Linkage;
- if (auto *VD = dyn_cast<VarDecl>(&D))
- Linkage = CGM.getContext().GetGVALinkageForVariable(VD);
- else
- Linkage = CGM.getContext().GetGVALinkageForFunction(cast<FunctionDecl>(&D));
-
- switch (Linkage) {
- case GVA_Internal:
- case GVA_AvailableExternally:
- case GVA_StrongExternal:
- return false;
- case GVA_DiscardableODR:
- case GVA_StrongODR:
- return true;
- }
- llvm_unreachable("No such linkage");
-}
-
void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D) {
llvm::Constant *Init = nullptr;
QualType ASTTy = D->getType();
@@ -2096,9 +2071,6 @@ void CodeGenModule::EmitGlobalVarDefinit
setTLSMode(GV, *D);
}
- if (shouldBeInCOMDAT(*this, *D))
- GV->setComdat(TheModule.getOrInsertComdat(GV->getName()));
-
// Emit the initializer function if necessary.
if (NeedsGlobalCtor || NeedsGlobalDtor)
EmitCXXGlobalVarDeclInitFunc(D, GV, NeedsGlobalCtor);
@@ -2433,9 +2405,6 @@ void CodeGenModule::EmitGlobalFunctionDe
MaybeHandleStaticInExternC(D, Fn);
- if (shouldBeInCOMDAT(*this, *D))
- Fn->setComdat(TheModule.getOrInsertComdat(Fn->getName()));
-
CodeGenFunction(*this).GenerateCode(D, Fn, FI);
setFunctionDefinitionAttributes(D, Fn);
Modified: cfe/branches/release_36/lib/CodeGen/ItaniumCXXABI.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_36/lib/CodeGen/ItaniumCXXABI.cpp?rev=226699&r1=226698&r2=226699&view=diff
==============================================================================
--- cfe/branches/release_36/lib/CodeGen/ItaniumCXXABI.cpp (original)
+++ cfe/branches/release_36/lib/CodeGen/ItaniumCXXABI.cpp Wed Jan 21 14:37:18 2015
@@ -1711,12 +1711,11 @@ void ItaniumCXXABI::EmitGuardedInit(Code
// 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);
Modified: cfe/branches/release_36/lib/CodeGen/MicrosoftCXXABI.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_36/lib/CodeGen/MicrosoftCXXABI.cpp?rev=226699&r1=226698&r2=226699&view=diff
==============================================================================
--- cfe/branches/release_36/lib/CodeGen/MicrosoftCXXABI.cpp (original)
+++ cfe/branches/release_36/lib/CodeGen/MicrosoftCXXABI.cpp Wed Jan 21 14:37:18 2015
@@ -1829,10 +1829,18 @@ void MicrosoftCXXABI::EmitThreadLocalIni
llvm::Function *F = CXXThreadLocalInits[I];
// If the GV is already in a comdat group, then we have to join it.
- if (llvm::Comdat *C = GV->getComdat())
+ llvm::Comdat *C = GV->getComdat();
+
+ // LinkOnce and Weak linkage are lowered down to a single-member comdat
+ // group.
+ // Make an explicit group so we can join it.
+ if (!C && (GV->hasWeakLinkage() || GV->hasLinkOnceLinkage())) {
+ C = CGM.getModule().getOrInsertComdat(GV->getName());
+ GV->setComdat(C);
AddToXDU(F)->setComdat(C);
- else
+ } else {
NonComdatInits.push_back(F);
+ }
}
if (!NonComdatInits.empty()) {
Modified: cfe/branches/release_36/test/CodeGen/ms-declspecs.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_36/test/CodeGen/ms-declspecs.c?rev=226699&r1=226698&r2=226699&view=diff
==============================================================================
--- cfe/branches/release_36/test/CodeGen/ms-declspecs.c (original)
+++ cfe/branches/release_36/test/CodeGen/ms-declspecs.c Wed Jan 21 14:37:18 2015
@@ -2,8 +2,8 @@
__declspec(selectany) int x1 = 1;
const __declspec(selectany) int x2 = 2;
-// CHECK: @x1 = weak_odr global i32 1, comdat, align 4
-// CHECK: @x2 = weak_odr constant i32 2, comdat, align 4
+// CHECK: @x1 = weak_odr global i32 1, align 4
+// CHECK: @x2 = weak_odr constant i32 2, align 4
struct __declspec(align(16)) S {
char x;
Modified: cfe/branches/release_36/test/CodeGenCXX/cxx11-exception-spec.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_36/test/CodeGenCXX/cxx11-exception-spec.cpp?rev=226699&r1=226698&r2=226699&view=diff
==============================================================================
--- cfe/branches/release_36/test/CodeGenCXX/cxx11-exception-spec.cpp (original)
+++ cfe/branches/release_36/test/CodeGenCXX/cxx11-exception-spec.cpp Wed Jan 21 14:37:18 2015
@@ -22,9 +22,9 @@ template<> void S<short>::f() { h(); }
// CHECK: define {{.*}} @_ZN1SIA2_sE1fEv() [[NUW]]
template<> void S<short[2]>::f() noexcept { h(); }
-// CHECK: define {{.*}} @_Z1fIDsEvv() [[NONE]] comdat {
+// CHECK: define {{.*}} @_Z1fIDsEvv() [[NONE]] {
template void f<char16_t>();
-// CHECK: define {{.*}} @_Z1fIA2_DsEvv() [[NUW]] comdat {
+// CHECK: define {{.*}} @_Z1fIA2_DsEvv() [[NUW]] {
template void f<char16_t[2]>();
// CHECK: define {{.*}} @_ZN1SIDsE1fEv()
@@ -34,9 +34,9 @@ template void S<char16_t>::f();
template void S<char16_t[2]>::f();
void h() {
- // CHECK: define {{.*}} @_Z1fIiEvv() [[NUW]] comdat {
+ // CHECK: define {{.*}} @_Z1fIiEvv() [[NUW]] {
f<int>();
- // CHECK: define {{.*}} @_Z1fIA2_iEvv() [[NONE]] comdat {
+ // CHECK: define {{.*}} @_Z1fIA2_iEvv() [[NONE]] {
f<int[2]>();
// CHECK: define {{.*}} @_ZN1SIiE1fEv() [[NUW]]
@@ -45,9 +45,9 @@ void h() {
// CHECK-NOT: [[NUW]]
S<int[2]>::f();
- // CHECK: define {{.*}} @_Z1fIfEvv() [[NUW]] comdat {
+ // CHECK: define {{.*}} @_Z1fIfEvv() [[NUW]] {
void (*f1)() = &f<float>;
- // CHECK: define {{.*}} @_Z1fIdEvv() [[NONE]] comdat {
+ // CHECK: define {{.*}} @_Z1fIdEvv() [[NONE]] {
void (*f2)() = &f<double>;
// CHECK: define {{.*}} @_ZN1SIfE1fEv() [[NUW]]
@@ -56,9 +56,9 @@ void h() {
// CHECK-NOT: [[NUW]]
void (*f4)() = &S<double>::f;
- // CHECK: define {{.*}} @_Z1fIA4_cEvv() [[NUW]] comdat {
+ // CHECK: define {{.*}} @_Z1fIA4_cEvv() [[NUW]] {
(void)&f<char[4]>;
- // CHECK: define {{.*}} @_Z1fIcEvv() [[NONE]] comdat {
+ // CHECK: define {{.*}} @_Z1fIcEvv() [[NONE]] {
(void)&f<char>;
// CHECK: define {{.*}} @_ZN1SIA4_cE1fEv() [[NUW]]
Modified: cfe/branches/release_36/test/CodeGenCXX/dllexport-members.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_36/test/CodeGenCXX/dllexport-members.cpp?rev=226699&r1=226698&r2=226699&view=diff
==============================================================================
--- cfe/branches/release_36/test/CodeGenCXX/dllexport-members.cpp (original)
+++ cfe/branches/release_36/test/CodeGenCXX/dllexport-members.cpp Wed Jan 21 14:37:18 2015
@@ -110,9 +110,9 @@ public:
// MSC-DAG: @"\01?StaticField at ExportMembers@@2HA" = dllexport global i32 1, align 4
// MSC-DAG: @"\01?StaticConstField at ExportMembers@@2HB" = dllexport constant i32 1, align 4
- // MSC-DAG: @"\01?StaticConstFieldEqualInit at ExportMembers@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4
- // MSC-DAG: @"\01?StaticConstFieldBraceInit at ExportMembers@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4
- // MSC-DAG: @"\01?ConstexprField at ExportMembers@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4
+ // MSC-DAG: @"\01?StaticConstFieldEqualInit at ExportMembers@@2HB" = weak_odr dllexport constant i32 1, align 4
+ // MSC-DAG: @"\01?StaticConstFieldBraceInit at ExportMembers@@2HB" = weak_odr dllexport constant i32 1, align 4
+ // MSC-DAG: @"\01?ConstexprField at ExportMembers@@2HB" = weak_odr dllexport constant i32 1, align 4
// GNU-DAG: @_ZN13ExportMembers11StaticFieldE = dllexport global i32 1, align 4
// GNU-DAG: @_ZN13ExportMembers16StaticConstFieldE = dllexport constant i32 1, align 4
// GNU-DAG: @_ZN13ExportMembers25StaticConstFieldEqualInitE = dllexport constant i32 1, align 4
@@ -233,9 +233,9 @@ public:
// MSC-DAG: @"\01?StaticField at Nested@ExportMembers@@2HA" = dllexport global i32 1, align 4
// MSC-DAG: @"\01?StaticConstField at Nested@ExportMembers@@2HB" = dllexport constant i32 1, align 4
- // MSC-DAG: @"\01?StaticConstFieldEqualInit at Nested@ExportMembers@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4
- // MSC-DAG: @"\01?StaticConstFieldBraceInit at Nested@ExportMembers@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4
- // MSC-DAG: @"\01?ConstexprField at Nested@ExportMembers@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4
+ // MSC-DAG: @"\01?StaticConstFieldEqualInit at Nested@ExportMembers@@2HB" = weak_odr dllexport constant i32 1, align 4
+ // MSC-DAG: @"\01?StaticConstFieldBraceInit at Nested@ExportMembers@@2HB" = weak_odr dllexport constant i32 1, align 4
+ // MSC-DAG: @"\01?ConstexprField at Nested@ExportMembers@@2HB" = weak_odr dllexport constant i32 1, align 4
// GNU-DAG: @_ZN13ExportMembers6Nested11StaticFieldE = dllexport global i32 1, align 4
// GNU-DAG: @_ZN13ExportMembers6Nested16StaticConstFieldE = dllexport constant i32 1, align 4
// GNU-DAG: @_ZN13ExportMembers6Nested25StaticConstFieldEqualInitE = dllexport constant i32 1, align 4
@@ -599,21 +599,21 @@ template<typename T> const int MemVarTmp
template<typename T> const int MemVarTmpl::ExportedStaticVar;
// Export implicit instantiation of an exported member variable template.
-// MSC-DAG: @"\01??$ExportedStaticVar at UImplicitInst_Exported@@@MemVarTmpl@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4
-// GNU-DAG: @_ZN10MemVarTmpl17ExportedStaticVarI21ImplicitInst_ExportedEE = weak_odr dllexport constant i32 1, comdat, align 4
+// MSC-DAG: @"\01??$ExportedStaticVar at UImplicitInst_Exported@@@MemVarTmpl@@2HB" = weak_odr dllexport constant i32 1, align 4
+// GNU-DAG: @_ZN10MemVarTmpl17ExportedStaticVarI21ImplicitInst_ExportedEE = weak_odr dllexport constant i32 1, align 4
int useMemVarTmpl() { return MemVarTmpl::ExportedStaticVar<ImplicitInst_Exported>; }
// Export explicit instantiation declaration of an exported member variable
// template.
-// MSC-DAG: @"\01??$ExportedStaticVar at UExplicitDecl_Exported@@@MemVarTmpl@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4
-// GNU-DAG: @_ZN10MemVarTmpl17ExportedStaticVarI21ExplicitDecl_ExportedEE = weak_odr dllexport constant i32 1, comdat, align 4
+// MSC-DAG: @"\01??$ExportedStaticVar at UExplicitDecl_Exported@@@MemVarTmpl@@2HB" = weak_odr dllexport constant i32 1, align 4
+// GNU-DAG: @_ZN10MemVarTmpl17ExportedStaticVarI21ExplicitDecl_ExportedEE = weak_odr dllexport constant i32 1, align 4
extern template const int MemVarTmpl::ExportedStaticVar<ExplicitDecl_Exported>;
template const int MemVarTmpl::ExportedStaticVar<ExplicitDecl_Exported>;
// Export explicit instantiation definition of an exported member variable
// template.
-// MSC-DAG: @"\01??$ExportedStaticVar at UExplicitInst_Exported@@@MemVarTmpl@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4
-// GNU-DAG: @_ZN10MemVarTmpl17ExportedStaticVarI21ExplicitInst_ExportedEE = weak_odr dllexport constant i32 1, comdat, align 4
+// MSC-DAG: @"\01??$ExportedStaticVar at UExplicitInst_Exported@@@MemVarTmpl@@2HB" = weak_odr dllexport constant i32 1, align 4
+// GNU-DAG: @_ZN10MemVarTmpl17ExportedStaticVarI21ExplicitInst_ExportedEE = weak_odr dllexport constant i32 1, align 4
template const int MemVarTmpl::ExportedStaticVar<ExplicitInst_Exported>;
// Export specialization of an exported member variable template.
@@ -630,15 +630,15 @@ template<> const int MemVarTmpl::Exporte
// Export explicit instantiation declaration of a non-exported member variable
// template.
-// MSC-DAG: @"\01??$StaticVar at UExplicitDecl_Exported@@@MemVarTmpl@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4
-// GNU-DAG: @_ZN10MemVarTmpl9StaticVarI21ExplicitDecl_ExportedEE = weak_odr dllexport constant i32 1, comdat, align 4
+// MSC-DAG: @"\01??$StaticVar at UExplicitDecl_Exported@@@MemVarTmpl@@2HB" = weak_odr dllexport constant i32 1, align 4
+// GNU-DAG: @_ZN10MemVarTmpl9StaticVarI21ExplicitDecl_ExportedEE = weak_odr dllexport constant i32 1, align 4
extern template __declspec(dllexport) const int MemVarTmpl::StaticVar<ExplicitDecl_Exported>;
template __declspec(dllexport) const int MemVarTmpl::StaticVar<ExplicitDecl_Exported>;
// Export explicit instantiation definition of a non-exported member variable
// template.
-// MSC-DAG: @"\01??$StaticVar at UExplicitInst_Exported@@@MemVarTmpl@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4
-// GNU-DAG: @_ZN10MemVarTmpl9StaticVarI21ExplicitInst_ExportedEE = weak_odr dllexport constant i32 1, comdat, align 4
+// MSC-DAG: @"\01??$StaticVar at UExplicitInst_Exported@@@MemVarTmpl@@2HB" = weak_odr dllexport constant i32 1, align 4
+// GNU-DAG: @_ZN10MemVarTmpl9StaticVarI21ExplicitInst_ExportedEE = weak_odr dllexport constant i32 1, align 4
template __declspec(dllexport) const int MemVarTmpl::StaticVar<ExplicitInst_Exported>;
// Export specialization of a non-exported member variable template.
Modified: cfe/branches/release_36/test/CodeGenCXX/dllexport.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_36/test/CodeGenCXX/dllexport.cpp?rev=226699&r1=226698&r2=226699&view=diff
==============================================================================
--- cfe/branches/release_36/test/CodeGenCXX/dllexport.cpp (original)
+++ cfe/branches/release_36/test/CodeGenCXX/dllexport.cpp Wed Jan 21 14:37:18 2015
@@ -110,43 +110,43 @@ template<typename T> __declspec(dllexpor
USEVAR(VarTmplImplicitDef<ImplicitInst_Exported>)
// Export definition.
-// MSC-DAG: @"\01??$VarTmplInit1 at UExplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, comdat, align 4
-// GNU-DAG: @_Z12VarTmplInit1I21ExplicitInst_ExportedE = weak_odr dllexport global i32 1, comdat, align 4
+// MSC-DAG: @"\01??$VarTmplInit1 at UExplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, align 4
+// GNU-DAG: @_Z12VarTmplInit1I21ExplicitInst_ExportedE = weak_odr dllexport global i32 1, align 4
template<typename T> __declspec(dllexport) int VarTmplInit1 = 1;
INSTVAR(VarTmplInit1<ExplicitInst_Exported>)
-// MSC-DAG: @"\01??$VarTmplInit2 at UExplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, comdat, align 4
-// GNU-DAG: @_Z12VarTmplInit2I21ExplicitInst_ExportedE = weak_odr dllexport global i32 1, comdat, align 4
+// MSC-DAG: @"\01??$VarTmplInit2 at UExplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, align 4
+// GNU-DAG: @_Z12VarTmplInit2I21ExplicitInst_ExportedE = weak_odr dllexport global i32 1, align 4
template<typename T> int __declspec(dllexport) VarTmplInit2 = 1;
INSTVAR(VarTmplInit2<ExplicitInst_Exported>)
// Declare, then export definition.
-// MSC-DAG: @"\01??$VarTmplDeclInit at UExplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, comdat, align 4
-// GNU-DAG: @_Z15VarTmplDeclInitI21ExplicitInst_ExportedE = weak_odr dllexport global i32 1, comdat, align 4
+// MSC-DAG: @"\01??$VarTmplDeclInit at UExplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, align 4
+// GNU-DAG: @_Z15VarTmplDeclInitI21ExplicitInst_ExportedE = weak_odr dllexport global i32 1, align 4
template<typename T> __declspec(dllexport) extern int VarTmplDeclInit;
template<typename T> int VarTmplDeclInit = 1;
INSTVAR(VarTmplDeclInit<ExplicitInst_Exported>)
// Redeclarations
-// MSC-DAG: @"\01??$VarTmplRedecl1 at UExplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, comdat, align 4
-// GNU-DAG: @_Z14VarTmplRedecl1I21ExplicitInst_ExportedE = weak_odr dllexport global i32 1, comdat, align 4
+// MSC-DAG: @"\01??$VarTmplRedecl1 at UExplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, align 4
+// GNU-DAG: @_Z14VarTmplRedecl1I21ExplicitInst_ExportedE = weak_odr dllexport global i32 1, align 4
template<typename T> __declspec(dllexport) extern int VarTmplRedecl1;
template<typename T> __declspec(dllexport) int VarTmplRedecl1 = 1;
INSTVAR(VarTmplRedecl1<ExplicitInst_Exported>)
-// MSC-DAG: @"\01??$VarTmplRedecl2 at UExplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, comdat, align 4
-// GNU-DAG: @_Z14VarTmplRedecl2I21ExplicitInst_ExportedE = weak_odr dllexport global i32 1, comdat, align 4
+// MSC-DAG: @"\01??$VarTmplRedecl2 at UExplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, align 4
+// GNU-DAG: @_Z14VarTmplRedecl2I21ExplicitInst_ExportedE = weak_odr dllexport global i32 1, align 4
template<typename T> __declspec(dllexport) extern int VarTmplRedecl2;
template<typename T> int VarTmplRedecl2 = 1;
INSTVAR(VarTmplRedecl2<ExplicitInst_Exported>)
-// MSC-DAG: @"\01??$ExternalVarTmpl at UExplicitInst_Exported@@@ns@@3HA" = weak_odr dllexport global i32 1, comdat, align 4
-// GNU-DAG: @_ZN2ns15ExternalVarTmplI21ExplicitInst_ExportedEE = weak_odr dllexport global i32 1, comdat, align 4
+// MSC-DAG: @"\01??$ExternalVarTmpl at UExplicitInst_Exported@@@ns@@3HA" = weak_odr dllexport global i32 1, align 4
+// GNU-DAG: @_ZN2ns15ExternalVarTmplI21ExplicitInst_ExportedEE = weak_odr dllexport global i32 1, align 4
namespace ns { template<typename T> __declspec(dllexport) int ExternalVarTmpl = 1; }
INSTVAR(ns::ExternalVarTmpl<ExplicitInst_Exported>)
-// MSC-DAG: @"\01??$ExternalAutoTypeVarTmpl at UExplicitInst_Exported@@@@3UExternal@@A" = weak_odr dllexport global %struct.External zeroinitializer, comdat, align 4
-// GNU-DAG: @_Z23ExternalAutoTypeVarTmplI21ExplicitInst_ExportedE = weak_odr dllexport global %struct.External zeroinitializer, comdat, align 4
+// MSC-DAG: @"\01??$ExternalAutoTypeVarTmpl at UExplicitInst_Exported@@@@3UExternal@@A" = weak_odr dllexport global %struct.External zeroinitializer, align 4
+// GNU-DAG: @_Z23ExternalAutoTypeVarTmplI21ExplicitInst_ExportedE = weak_odr dllexport global %struct.External zeroinitializer, align 4
template<typename T> __declspec(dllexport) auto ExternalAutoTypeVarTmpl = External();
template External ExternalAutoTypeVarTmpl<ExplicitInst_Exported>;
@@ -155,19 +155,19 @@ template<typename T> int VarTmpl = 1;
template<typename T> __declspec(dllexport) int ExportedVarTmpl = 1;
// Export implicit instantiation of an exported variable template.
-// MSC-DAG: @"\01??$ExportedVarTmpl at UImplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, comdat, align 4
-// GNU-DAG: @_Z15ExportedVarTmplI21ImplicitInst_ExportedE = weak_odr dllexport global i32 1, comdat, align 4
+// MSC-DAG: @"\01??$ExportedVarTmpl at UImplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, align 4
+// GNU-DAG: @_Z15ExportedVarTmplI21ImplicitInst_ExportedE = weak_odr dllexport global i32 1, align 4
USEVAR(ExportedVarTmpl<ImplicitInst_Exported>)
// Export explicit instantiation declaration of an exported variable template.
-// MSC-DAG: @"\01??$ExportedVarTmpl at UImplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, comdat, align 4
-// GNU-DAG: @_Z15ExportedVarTmplI21ExplicitDecl_ExportedE = weak_odr dllexport global i32 1, comdat, align 4
+// MSC-DAG: @"\01??$ExportedVarTmpl at UImplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, align 4
+// GNU-DAG: @_Z15ExportedVarTmplI21ExplicitDecl_ExportedE = weak_odr dllexport global i32 1, align 4
extern template int ExportedVarTmpl<ExplicitDecl_Exported>;
template int ExportedVarTmpl<ExplicitDecl_Exported>;
// Export explicit instantiation definition of an exported variable template.
-// MSC-DAG: @"\01??$ExportedVarTmpl at UImplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, comdat, align 4
-// GNU-DAG: @_Z15ExportedVarTmplI21ExplicitInst_ExportedE = weak_odr dllexport global i32 1, comdat, align 4
+// MSC-DAG: @"\01??$ExportedVarTmpl at UImplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, align 4
+// GNU-DAG: @_Z15ExportedVarTmplI21ExplicitInst_ExportedE = weak_odr dllexport global i32 1, align 4
template __declspec(dllexport) int ExportedVarTmpl<ExplicitInst_Exported>;
// Export specialization of an exported variable template.
@@ -187,14 +187,14 @@ template<> int ExportedVarTmpl<ExplicitS
// Export explicit instantiation declaration of a non-exported variable template.
-// MSC-DAG: @"\01??$VarTmpl at UExplicitDecl_Exported@@@@3HA" = weak_odr dllexport global i32 1, comdat, align 4
-// GNU-DAG: @_Z7VarTmplI21ExplicitDecl_ExportedE = weak_odr dllexport global i32 1, comdat, align 4
+// MSC-DAG: @"\01??$VarTmpl at UExplicitDecl_Exported@@@@3HA" = weak_odr dllexport global i32 1, align 4
+// GNU-DAG: @_Z7VarTmplI21ExplicitDecl_ExportedE = weak_odr dllexport global i32 1, align 4
extern template __declspec(dllexport) int VarTmpl<ExplicitDecl_Exported>;
template __declspec(dllexport) int VarTmpl<ExplicitDecl_Exported>;
// Export explicit instantiation definition of a non-exported variable template.
-// MSC-DAG: @"\01??$VarTmpl at UExplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, comdat, align 4
-// GNU-DAG: @_Z7VarTmplI21ExplicitInst_ExportedE = weak_odr dllexport global i32 1, comdat, align 4
+// MSC-DAG: @"\01??$VarTmpl at UExplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, align 4
+// GNU-DAG: @_Z7VarTmplI21ExplicitInst_ExportedE = weak_odr dllexport global i32 1, align 4
template __declspec(dllexport) int VarTmpl<ExplicitInst_Exported>;
// Export specialization of a non-exported variable template.
Modified: cfe/branches/release_36/test/CodeGenCXX/dllimport.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_36/test/CodeGenCXX/dllimport.cpp?rev=226699&r1=226698&r2=226699&view=diff
==============================================================================
--- cfe/branches/release_36/test/CodeGenCXX/dllimport.cpp (original)
+++ cfe/branches/release_36/test/CodeGenCXX/dllimport.cpp Wed Jan 21 14:37:18 2015
@@ -243,7 +243,7 @@ __declspec(dllimport) __attribute__((noi
USE(noinline)
// MSC2-NOT: @"\01?alwaysInline@@YAXXZ"()
-// GNU-DAG: define linkonce_odr void @_Z12alwaysInlinev() {{.*}} comdat {
+// GNU2-NOT: @_Z12alwaysInlinev()
__declspec(dllimport) __attribute__((always_inline)) inline void alwaysInline() {}
USE(alwaysInline)
Modified: cfe/branches/release_36/test/CodeGenCXX/ms-integer-static-data-members-exported.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_36/test/CodeGenCXX/ms-integer-static-data-members-exported.cpp?rev=226699&r1=226698&r2=226699&view=diff
==============================================================================
--- cfe/branches/release_36/test/CodeGenCXX/ms-integer-static-data-members-exported.cpp (original)
+++ cfe/branches/release_36/test/CodeGenCXX/ms-integer-static-data-members-exported.cpp Wed Jan 21 14:37:18 2015
@@ -17,6 +17,6 @@ struct __declspec(dllexport) S {
};
};
-// CHECK: @"\01?x at S@@2FB" = weak_odr dllexport constant i16 42, comdat, align 2
-// CHECK: @"\01?y at S@@2W4Enum@@B" = weak_odr dllexport constant i32 2, comdat, align 4
+// CHECK: @"\01?x at S@@2FB" = weak_odr dllexport constant i16 42, align 2
+// CHECK: @"\01?y at S@@2W4Enum@@B" = weak_odr dllexport constant i32 2, align 4
// CHECK-NOT: NonExported
Modified: cfe/branches/release_36/test/CodeGenCXX/ms-integer-static-data-members.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_36/test/CodeGenCXX/ms-integer-static-data-members.cpp?rev=226699&r1=226698&r2=226699&view=diff
==============================================================================
--- cfe/branches/release_36/test/CodeGenCXX/ms-integer-static-data-members.cpp (original)
+++ cfe/branches/release_36/test/CodeGenCXX/ms-integer-static-data-members.cpp Wed Jan 21 14:37:18 2015
@@ -26,7 +26,7 @@ const int S::x = 5;
// Inline initialization.
-// CHECK-INLINE: @"\01?x at S@@2HB" = linkonce_odr constant i32 5, comdat, align 4
+// CHECK-INLINE: @"\01?x at S@@2HB" = linkonce_odr constant i32 5, align 4
// Out-of-line initialization.
// CHECK-OUTOFLINE: @"\01?x at S@@2HB" = constant i32 5, align 4
Modified: cfe/branches/release_36/test/CodeGenCXX/split-stacks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_36/test/CodeGenCXX/split-stacks.cpp?rev=226699&r1=226698&r2=226699&view=diff
==============================================================================
--- cfe/branches/release_36/test/CodeGenCXX/split-stacks.cpp (original)
+++ cfe/branches/release_36/test/CodeGenCXX/split-stacks.cpp Wed Jan 21 14:37:18 2015
@@ -18,7 +18,7 @@ int nosplit() {
// CHECK-SEGSTK: define i32 @_Z3foov() [[SS:#[0-9]+]] {
// CHECK-SEGSTK: define i32 @_Z7nosplitv() [[NSS1:#[0-9]+]] {
-// CHECK-SEGSTK: define linkonce_odr i32 @_Z8tnosplitIiEiv() [[NSS2:#[0-9]+]] comdat {
+// CHECK-SEGSTK: define linkonce_odr i32 @_Z8tnosplitIiEiv() [[NSS2:#[0-9]+]] {
// CHECK-SEGSTK-NOT: [[NSS1]] = { {{.*}} "split-stack" {{.*}} }
// CHECK-SEGSTK-NOT: [[NSS2]] = { {{.*}} "split-stack" {{.*}} }
// CHECK-SEGSTK: [[SS]] = { {{.*}} "split-stack" {{.*}} }
@@ -27,7 +27,7 @@ int nosplit() {
// CHECK-NOSEGSTK: define i32 @_Z3foov() [[NSS0:#[0-9]+]] {
// CHECK-NOSEGSTK: define i32 @_Z7nosplitv() [[NSS1:#[0-9]+]] {
-// CHECK-NOSEGSTK: define linkonce_odr i32 @_Z8tnosplitIiEiv() [[NSS2:#[0-9]+]] comdat {
+// CHECK-NOSEGSTK: define linkonce_odr i32 @_Z8tnosplitIiEiv() [[NSS2:#[0-9]+]] {
// CHECK-NOSEGSTK-NOT: [[NSS1]] = { {{.*}} "split-stack" {{.*}} }
// CHECK-NOSEGSTK-NOT: [[NSS2]] = { {{.*}} "split-stack" {{.*}} }
// CHECK-NOSEGSTK-NOT: [[NSS3]] = { {{.*}} "split-stack" {{.*}} }
Modified: cfe/branches/release_36/test/CodeGenCXX/static-init.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_36/test/CodeGenCXX/static-init.cpp?rev=226699&r1=226698&r2=226699&view=diff
==============================================================================
--- cfe/branches/release_36/test/CodeGenCXX/static-init.cpp (original)
+++ cfe/branches/release_36/test/CodeGenCXX/static-init.cpp Wed Jan 21 14:37:18 2015
@@ -7,8 +7,10 @@
// CHECK: @_ZZN5test31BC1EvE1u = internal global { i8, [3 x i8] } { i8 97, [3 x i8] undef }, align 4
// CHECK: @_ZZN5test1L6getvarEiE3var = internal constant [4 x i32] [i32 1, i32 0, i32 2, i32 4], align 16
-// CHECK: @_ZZ2h2vE1i = linkonce_odr global i32 0, comdat, align
-// CHECK: @_ZGVZ2h2vE1i = linkonce_odr global i64 0, comdat{{$}}
+// CHECK: @_ZZ2h2vE1i = linkonce_odr global i32 0
+// CHECK-NOT: comdat
+// CHECK: @_ZGVZ2h2vE1i = linkonce_odr global i64 0
+// CHECK-NOT: comdat
struct A {
A();
@@ -35,7 +37,8 @@ void h() {
static const int i = a();
}
-// CHECK: define linkonce_odr void @_Z2h2v() {{.*}} comdat {
+// CHECK: define linkonce_odr void @_Z2h2v()
+// CHECK-NOT: comdat
inline void h2() {
static int i = a();
}
More information about the llvm-branch-commits
mailing list