[cfe-commits] r103203 - in /cfe/trunk: lib/CodeGen/CGVTT.cpp test/CodeGenCXX/anonymous-namespaces.cpp
Douglas Gregor
dgregor at apple.com
Thu May 6 15:18:21 PDT 2010
Author: dgregor
Date: Thu May 6 17:18:21 2010
New Revision: 103203
URL: http://llvm.org/viewvc/llvm-project?rev=103203&view=rev
Log:
The global variable for the VTT might not have external linkage; allow
us to find local variables, too. Fixes the last remaining
Boost.Rational failure.
Modified:
cfe/trunk/lib/CodeGen/CGVTT.cpp
cfe/trunk/test/CodeGenCXX/anonymous-namespaces.cpp
Modified: cfe/trunk/lib/CodeGen/CGVTT.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVTT.cpp?rev=103203&r1=103202&r2=103203&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGVTT.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVTT.cpp Thu May 6 17:18:21 2010
@@ -378,7 +378,7 @@
D1(printf("vtt %s\n", RD->getNameAsCString()));
- llvm::GlobalVariable *GV = CGM.getModule().getGlobalVariable(Name);
+ llvm::GlobalVariable *GV = CGM.getModule().getGlobalVariable(Name, true);
if (GV == 0 || GV->isDeclaration()) {
const llvm::Type *Int8PtrTy =
llvm::Type::getInt8PtrTy(CGM.getLLVMContext());
Modified: cfe/trunk/test/CodeGenCXX/anonymous-namespaces.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/anonymous-namespaces.cpp?rev=103203&r1=103202&r2=103203&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/anonymous-namespaces.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/anonymous-namespaces.cpp Thu May 6 17:18:21 2010
@@ -1,6 +1,5 @@
// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
-
int f();
namespace {
@@ -20,6 +19,13 @@
int D::d = f();
+ // Check for generation of a VTT with internal linkage
+ // CHECK: @_ZTSN12_GLOBAL__N_11X1EE = internal constant
+ struct X {
+ struct EBase { };
+ struct E : public virtual EBase { virtual ~E() {} };
+ };
+
// CHECK: define internal i32 @_ZN12_GLOBAL__N_13fooEv()
int foo() {
return 32;
@@ -36,3 +42,5 @@
int concrete() {
return a + foo() + A::foo();
}
+
+void test_XE() { throw X::E(); }
More information about the cfe-commits
mailing list