[cfe-commits] r116185 - in /cfe/trunk: lib/CodeGen/CGRTTI.cpp test/CodeGenCXX/rtti-linkage.cpp

Argyrios Kyrtzidis akyrtzi at gmail.com
Sun Oct 10 20:25:54 PDT 2010


Author: akirtzidis
Date: Sun Oct 10 22:25:53 2010
New Revision: 116185

URL: http://llvm.org/viewvc/llvm-project?rev=116185&view=rev
Log:
Don't let typeinfo name symbols be 'internal hidden', it can lead to linker conflicts
with similarly named classes in anonymous namespaces.

Modified:
    cfe/trunk/lib/CodeGen/CGRTTI.cpp
    cfe/trunk/test/CodeGenCXX/rtti-linkage.cpp

Modified: cfe/trunk/lib/CodeGen/CGRTTI.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGRTTI.cpp?rev=116185&r1=116184&r2=116185&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGRTTI.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGRTTI.cpp Sun Oct 10 22:25:53 2010
@@ -85,7 +85,7 @@
       OGV->replaceAllUsesWith(NewPtr);
       OGV->eraseFromParent();
     }
-    if (Hidden)
+    if (Hidden && Linkage != llvm::GlobalValue::InternalLinkage)
       GV->setVisibility(llvm::GlobalVariable::HiddenVisibility);
     return llvm::ConstantExpr::getBitCast(GV, Int8PtrTy);
   }

Modified: cfe/trunk/test/CodeGenCXX/rtti-linkage.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/rtti-linkage.cpp?rev=116185&r1=116184&r2=116185&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/rtti-linkage.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/rtti-linkage.cpp Sun Oct 10 22:25:53 2010
@@ -1,11 +1,12 @@
 // RUN: %clang_cc1 %s -I%S -triple=x86_64-apple-darwin10 -fhidden-weak-vtables -emit-llvm -o - | sort | FileCheck %s
+// RUN: %clang_cc1 %s -I%S -triple=x86_64-apple-darwin10 -fvisibility hidden -fhidden-weak-vtables -emit-llvm -o - | FileCheck -check-prefix=CHECK-WITH-HIDDEN %s
 
 // FIXME: Fails on Win32, dunno why.
 // XFAIL: win32
 
 #include <typeinfo>
 
-
+// CHECK-WITH-HIDDEN: _ZTSFN12_GLOBAL__N_11DEvE = internal constant
 
 // CHECK: _ZTIN12_GLOBAL__N_11DE to
 





More information about the cfe-commits mailing list