forked from OSchip/llvm-project
Compute the visibility of static local variables consistently. Fixes PR16208.
llvm-svn: 184137
This commit is contained in:
parent
180795863d
commit
40a4becb11
|
@ -218,8 +218,7 @@ CodeGenFunction::CreateStaticVarDecl(const VarDecl &D,
|
||||||
llvm::GlobalVariable::NotThreadLocal,
|
llvm::GlobalVariable::NotThreadLocal,
|
||||||
AddrSpace);
|
AddrSpace);
|
||||||
GV->setAlignment(getContext().getDeclAlign(&D).getQuantity());
|
GV->setAlignment(getContext().getDeclAlign(&D).getQuantity());
|
||||||
if (Linkage != llvm::GlobalValue::InternalLinkage)
|
CGM.setGlobalVisibility(GV, &D);
|
||||||
GV->setVisibility(CurFn->getVisibility());
|
|
||||||
|
|
||||||
if (D.getTLSKind())
|
if (D.getTLSKind())
|
||||||
CGM.setTLSMode(GV, D);
|
CGM.setTLSMode(GV, D);
|
||||||
|
|
|
@ -139,6 +139,10 @@ namespace test27 {
|
||||||
// CHECK: @_ZGVZN6Test193fooIiEEvvE1a = linkonce_odr global i64
|
// CHECK: @_ZGVZN6Test193fooIiEEvvE1a = linkonce_odr global i64
|
||||||
// CHECK-HIDDEN: @_ZZN6Test193fooIiEEvvE1a = linkonce_odr hidden global
|
// CHECK-HIDDEN: @_ZZN6Test193fooIiEEvvE1a = linkonce_odr hidden global
|
||||||
// CHECK-HIDDEN: @_ZGVZN6Test193fooIiEEvvE1a = linkonce_odr hidden global i64
|
// CHECK-HIDDEN: @_ZGVZN6Test193fooIiEEvvE1a = linkonce_odr hidden global i64
|
||||||
|
// CHECK: @_ZZN6test681fC1EvE4test = linkonce_odr global
|
||||||
|
// CHECK: @_ZGVZN6test681fC1EvE4test = linkonce_odr global
|
||||||
|
// CHECK-HIDDEN: @_ZZN6test681fC1EvE4test = linkonce_odr hidden global
|
||||||
|
// CHECK-HIDDEN: @_ZGVZN6test681fC1EvE4test = linkonce_odr hidden global
|
||||||
// CHECK-HIDDEN: @_ZTVN6Test161AIcEE = external unnamed_addr constant
|
// CHECK-HIDDEN: @_ZTVN6Test161AIcEE = external unnamed_addr constant
|
||||||
// CHECK-HIDDEN: @_ZTTN6Test161AIcEE = external unnamed_addr constant
|
// CHECK-HIDDEN: @_ZTTN6Test161AIcEE = external unnamed_addr constant
|
||||||
// CHECK: @_ZTVN5Test63fooE = linkonce_odr hidden unnamed_addr constant
|
// CHECK: @_ZTVN5Test63fooE = linkonce_odr hidden unnamed_addr constant
|
||||||
|
@ -1277,3 +1281,17 @@ namespace test67 {
|
||||||
// CHECK: define weak_odr void @_ZN6test673barINS_3fooEE3zedEv
|
// CHECK: define weak_odr void @_ZN6test673barINS_3fooEE3zedEv
|
||||||
// CHECK-HIDDEN: define weak_odr void @_ZN6test673barINS_3fooEE3zedEv
|
// CHECK-HIDDEN: define weak_odr void @_ZN6test673barINS_3fooEE3zedEv
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace test68 {
|
||||||
|
class A { public: ~A(); };
|
||||||
|
class f {
|
||||||
|
public:
|
||||||
|
f() {
|
||||||
|
static A test;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
void g() {
|
||||||
|
f a;
|
||||||
|
}
|
||||||
|
// Check lines at top of file.
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue