diff options
Diffstat (limited to 'clang/lib/CodeGen/ItaniumCXXABI.cpp')
-rw-r--r-- | clang/lib/CodeGen/ItaniumCXXABI.cpp | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/clang/lib/CodeGen/ItaniumCXXABI.cpp b/clang/lib/CodeGen/ItaniumCXXABI.cpp index 6254f359d59..df4a533d46e 100644 --- a/clang/lib/CodeGen/ItaniumCXXABI.cpp +++ b/clang/lib/CodeGen/ItaniumCXXABI.cpp @@ -300,16 +300,11 @@ public: // linkage together with vtables when needed. if (ForVTable && !Thunk->hasLocalLinkage()) Thunk->setLinkage(llvm::GlobalValue::AvailableExternallyLinkage); - - // Propagate dllexport storage, to enable the linker to generate import - // thunks as necessary (e.g. when a parent class has a key function and a - // child class doesn't, and the construction vtable for the parent in the - // child needs to reference the parent's thunks). - const CXXMethodDecl *MD = cast<CXXMethodDecl>(GD.getDecl()); - if (MD->hasAttr<DLLExportAttr>()) - Thunk->setDLLStorageClass(llvm::GlobalValue::DLLExportStorageClass); + CGM.setGVProperties(Thunk, GD); } + bool exportThunk() override { return true; } + llvm::Value *performThisAdjustment(CodeGenFunction &CGF, Address This, const ThisAdjustment &TA) override; @@ -1642,11 +1637,6 @@ llvm::GlobalVariable *ItaniumCXXABI::getAddrOfVTable(const CXXRecordDecl *RD, Name, VTableType, llvm::GlobalValue::ExternalLinkage); VTable->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global); - if (RD->hasAttr<DLLImportAttr>()) - VTable->setDLLStorageClass(llvm::GlobalValue::DLLImportStorageClass); - else if (RD->hasAttr<DLLExportAttr>()) - VTable->setDLLStorageClass(llvm::GlobalValue::DLLExportStorageClass); - CGM.setGVProperties(VTable, RD); return VTable; @@ -2627,8 +2617,7 @@ ItaniumRTTIBuilder::GetAddrOfExternalRTTIDescriptor(QualType Ty) { Name); if (const RecordType *RecordTy = dyn_cast<RecordType>(Ty)) { const CXXRecordDecl *RD = cast<CXXRecordDecl>(RecordTy->getDecl()); - if (RD->hasAttr<DLLImportAttr>()) - GV->setDLLStorageClass(llvm::GlobalVariable::DLLImportStorageClass); + CGM.setGVProperties(GV, RD); } } @@ -3637,7 +3626,7 @@ static void emitConstructorDestructorAlias(CodeGenModule &CGM, } // Finally, set up the alias with its proper name and attributes. - CGM.setAliasAttributes(AliasDecl, Alias); + CGM.SetCommonAttributes(AliasDecl, Alias); } void ItaniumCXXABI::emitCXXStructor(const CXXMethodDecl *MD, |