[cfe-commits] r89186 - in /cfe/trunk: lib/CodeGen/CGRtti.cpp test/CodeGenCXX/rtti.cpp
Mike Stump
mrs at apple.com
Tue Nov 17 19:21:30 PST 2009
Author: mrs
Date: Tue Nov 17 21:21:29 2009
New Revision: 89186
URL: http://llvm.org/viewvc/llvm-project?rev=89186&view=rev
Log:
Be sure to set visibility for ZTI symbols for classes from the class.
Modified:
cfe/trunk/lib/CodeGen/CGRtti.cpp
cfe/trunk/test/CodeGenCXX/rtti.cpp
Modified: cfe/trunk/lib/CodeGen/CGRtti.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGRtti.cpp?rev=89186&r1=89185&r2=89186&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGRtti.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGRtti.cpp Tue Nov 17 21:21:29 2009
@@ -145,7 +145,7 @@
llvm::Constant *finish(std::vector<llvm::Constant *> &info,
llvm::GlobalVariable *GV,
- llvm::StringRef Name) {
+ llvm::StringRef Name, bool Extern) {
llvm::GlobalVariable::LinkageTypes linktype;
linktype = llvm::GlobalValue::LinkOnceODRLinkage;
@@ -165,7 +165,8 @@
OGV->replaceAllUsesWith(NewPtr);
OGV->eraseFromParent();
}
- GV->setVisibility(llvm::GlobalVariable::HiddenVisibility);
+ if (!Extern)
+ GV->setVisibility(llvm::GlobalVariable::HiddenVisibility);
return llvm::ConstantExpr::getBitCast(GV, Int8PtrTy);
}
@@ -230,7 +231,9 @@
}
}
- return finish(info, GV, Out.str());
+ bool Extern = CGM.getDeclVisibilityMode(RD) != LangOptions::Hidden;
+
+ return finish(info, GV, Out.str(), Extern);
}
/// - BuildFlags - Build a __flags value for __pbase_type_info.
@@ -291,7 +294,7 @@
if (PtrMem)
info.push_back(BuildType2(BTy));
- return finish(info, GV, Out.str());
+ return finish(info, GV, Out.str(), false);
}
llvm::Constant *BuildSimpleType(QualType Ty, const char *vtbl) {
@@ -312,7 +315,7 @@
info.push_back(C);
info.push_back(BuildName(Ty));
- return finish(info, GV, Out.str());
+ return finish(info, GV, Out.str(), false);
}
llvm::Constant *BuildType(QualType Ty) {
Modified: cfe/trunk/test/CodeGenCXX/rtti.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/rtti.cpp?rev=89186&r1=89185&r2=89186&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/rtti.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/rtti.cpp Tue Nov 17 21:21:29 2009
@@ -41,7 +41,12 @@
// CHECK-NEXT: .space 4
// CHECK-NEXT: .quad __ZTIi
-// CHECK: __ZTIM7test3_Ai:
+// CHECK: .globl __ZTS7test3_A
+// CHECK-NEXT: .weak_definition __ZTS7test3_A
+// CHECK: __ZTS7test3_A:
+// CHECK-NEXT: .asciz "7test3_A"
+
+// CHECK: __ZTIM7test3_Ai:
// CHECK-NEXT: .quad (__ZTVN10__cxxabiv129__pointer_to_member_type_infoE) + 16
// CHECK-NEXT: .quad __ZTSM7test3_Ai
// CHECK-NEXT: .space 4
More information about the cfe-commits
mailing list