forked from OSchip/llvm-project
parent
2ecb7ba4c6
commit
e006b8f486
|
@ -2848,6 +2848,7 @@ void ItaniumRTTIBuilder::BuildVTablePointer(const Type *Ty) {
|
||||||
|
|
||||||
const char *VTableName = nullptr;
|
const char *VTableName = nullptr;
|
||||||
|
|
||||||
|
const CXXRecordDecl *RD = nullptr;
|
||||||
switch (Ty->getTypeClass()) {
|
switch (Ty->getTypeClass()) {
|
||||||
#define TYPE(Class, Base)
|
#define TYPE(Class, Base)
|
||||||
#define ABSTRACT_TYPE(Class, Base)
|
#define ABSTRACT_TYPE(Class, Base)
|
||||||
|
@ -2899,8 +2900,7 @@ void ItaniumRTTIBuilder::BuildVTablePointer(const Type *Ty) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Type::Record: {
|
case Type::Record: {
|
||||||
const CXXRecordDecl *RD =
|
RD = cast<CXXRecordDecl>(cast<RecordType>(Ty)->getDecl());
|
||||||
cast<CXXRecordDecl>(cast<RecordType>(Ty)->getDecl());
|
|
||||||
|
|
||||||
if (!RD->hasDefinition() || !RD->getNumBases()) {
|
if (!RD->hasDefinition() || !RD->getNumBases()) {
|
||||||
VTableName = ClassTypeInfo;
|
VTableName = ClassTypeInfo;
|
||||||
|
@ -2948,6 +2948,7 @@ void ItaniumRTTIBuilder::BuildVTablePointer(const Type *Ty) {
|
||||||
|
|
||||||
llvm::Constant *VTable =
|
llvm::Constant *VTable =
|
||||||
CGM.getModule().getOrInsertGlobal(VTableName, CGM.Int8PtrTy);
|
CGM.getModule().getOrInsertGlobal(VTableName, CGM.Int8PtrTy);
|
||||||
|
CGM.setGVProperties(cast<llvm::GlobalValue>(VTable->stripPointerCasts()), RD);
|
||||||
|
|
||||||
llvm::Type *PtrDiffTy =
|
llvm::Type *PtrDiffTy =
|
||||||
CGM.getTypes().ConvertType(CGM.getContext().getPointerDiffType());
|
CGM.getTypes().ConvertType(CGM.getContext().getPointerDiffType());
|
||||||
|
|
|
@ -41,6 +41,8 @@ struct External { int v; };
|
||||||
// GNU-NOT: @ExternGlobalDecl
|
// GNU-NOT: @ExternGlobalDecl
|
||||||
__declspec(dllexport) extern int ExternGlobalDecl;
|
__declspec(dllexport) extern int ExternGlobalDecl;
|
||||||
|
|
||||||
|
// GNU-DAG: @_ZTVN10__cxxabiv117__class_type_infoE = external dso_local global
|
||||||
|
|
||||||
// dllexport implies a definition.
|
// dllexport implies a definition.
|
||||||
// MSC-DAG: @"?GlobalDef@@3HA" = dso_local dllexport global i32 0, align 4
|
// MSC-DAG: @"?GlobalDef@@3HA" = dso_local dllexport global i32 0, align 4
|
||||||
// GNU-DAG: @GlobalDef = dso_local dllexport global i32 0, align 4
|
// GNU-DAG: @GlobalDef = dso_local dllexport global i32 0, align 4
|
||||||
|
|
Loading…
Reference in New Issue