summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/MicrosoftCXXABI.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-02-02 10:22:20 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-02-02 10:22:20 +0000
commit129f417efdab746c92598fbf0b32f487db2d2f20 (patch)
tree06da377b4b488a9884fc18eaa5929bc6827ec976 /clang/lib/CodeGen/MicrosoftCXXABI.cpp
parent1f83bbb6feebb05f5ca7fb085d80eb5653476636 (diff)
downloadbcm5719-llvm-129f417efdab746c92598fbf0b32f487db2d2f20.tar.gz
bcm5719-llvm-129f417efdab746c92598fbf0b32f487db2d2f20.zip
MS ABI: Implement support for 'novtable'
It is common for COM interface classes to be marked as 'novtable' to tell the compiler that constructors and destructors should not reference virtual function tables. This commit implements this feature in clang. llvm-svn: 227796
Diffstat (limited to 'clang/lib/CodeGen/MicrosoftCXXABI.cpp')
-rw-r--r--clang/lib/CodeGen/MicrosoftCXXABI.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/MicrosoftCXXABI.cpp b/clang/lib/CodeGen/MicrosoftCXXABI.cpp
index 40f88f32a99..48adf3a23d7 100644
--- a/clang/lib/CodeGen/MicrosoftCXXABI.cpp
+++ b/clang/lib/CodeGen/MicrosoftCXXABI.cpp
@@ -1582,7 +1582,8 @@ void MicrosoftCXXABI::emitVirtualInheritanceTables(const CXXRecordDecl *RD) {
for (unsigned I = 0, E = VBGlobals.VBTables->size(); I != E; ++I) {
const VPtrInfo *VBT = (*VBGlobals.VBTables)[I];
llvm::GlobalVariable *GV = VBGlobals.Globals[I];
- emitVBTableDefinition(*VBT, RD, GV);
+ if (GV->isDeclaration())
+ emitVBTableDefinition(*VBT, RD, GV);
}
}
@@ -1609,6 +1610,9 @@ MicrosoftCXXABI::getAddrOfVBTable(const VPtrInfo &VBT, const CXXRecordDecl *RD,
else if (RD->hasAttr<DLLExportAttr>())
GV->setDLLStorageClass(llvm::GlobalValue::DLLExportStorageClass);
+ if (!GV->hasExternalLinkage())
+ emitVBTableDefinition(VBT, RD, GV);
+
return GV;
}
OpenPOWER on IntegriCloud