forked from OSchip/llvm-project
Use GetAddrOfRTTI when getting the RTTI pointer for a base class.
llvm-svn: 91127
This commit is contained in:
parent
83c49b56fe
commit
a0b98f083a
|
@ -257,10 +257,7 @@ public:
|
||||||
e = RD->bases_end(); i != e; ++i) {
|
e = RD->bases_end(); i != e; ++i) {
|
||||||
const CXXRecordDecl *Base =
|
const CXXRecordDecl *Base =
|
||||||
cast<CXXRecordDecl>(i->getType()->getAs<RecordType>()->getDecl());
|
cast<CXXRecordDecl>(i->getType()->getAs<RecordType>()->getDecl());
|
||||||
if (Base->isPolymorphic())
|
info.push_back(CGM.GetAddrOfRTTI(Base));
|
||||||
info.push_back(CGM.GenerateRTTIRef(Base));
|
|
||||||
else
|
|
||||||
info.push_back(CGM.GenerateRTTI(Base));
|
|
||||||
if (simple)
|
if (simple)
|
||||||
break;
|
break;
|
||||||
int64_t offset;
|
int64_t offset;
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
// RUN: clang-cc %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s
|
||||||
|
|
||||||
|
// CHECK: _ZTS1B = constant
|
||||||
|
// CHECK: _ZTS1A = weak_odr constant
|
||||||
|
// CHECK: _ZTI1A = weak_odr constant
|
||||||
|
// CHECK: _ZTI1B = constant
|
||||||
|
|
||||||
|
// A has no key function, so its RTTI data should be weak_odr.
|
||||||
|
struct A { };
|
||||||
|
|
||||||
|
// B has a key function defined in the translation unit, so the RTTI data should
|
||||||
|
// be emitted in this translation unit and have external linkage.
|
||||||
|
struct B : A {
|
||||||
|
virtual void f();
|
||||||
|
};
|
||||||
|
void B::f() { }
|
Loading…
Reference in New Issue