summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2016-02-22 17:22:08 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2016-02-22 17:22:08 +0000
commit46e39cc6b0af95ffdc2ff21c9387c1939c82cd7c (patch)
tree1c438412400bf76c35fd50f1090dbcadac8df3f6 /clang/lib/CodeGen
parent2ae61ee0d258cde2d001e5f1d23157e82ae7cb3b (diff)
downloadbcm5719-llvm-46e39cc6b0af95ffdc2ff21c9387c1939c82cd7c.tar.gz
bcm5719-llvm-46e39cc6b0af95ffdc2ff21c9387c1939c82cd7c.zip
[MS ABI] Correctly handle dllimport'd explicit instantiation declaration w/ vbases
We gave a VBTable dllimport storage class and external linkage while also providing an initializer. An initializer is only valid if the VBTable has available_externally linkage. Fix this by setting the linkage to available_externally in situ while generating the initializer. This fixes PR26686. llvm-svn: 261535
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/MicrosoftCXXABI.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/MicrosoftCXXABI.cpp b/clang/lib/CodeGen/MicrosoftCXXABI.cpp
index 2567aa92f25..eecb12c6595 100644
--- a/clang/lib/CodeGen/MicrosoftCXXABI.cpp
+++ b/clang/lib/CodeGen/MicrosoftCXXABI.cpp
@@ -2039,6 +2039,9 @@ void MicrosoftCXXABI::emitVBTableDefinition(const VPtrInfo &VBT,
llvm::ArrayType::get(CGM.IntTy, Offsets.size());
llvm::Constant *Init = llvm::ConstantArray::get(VBTableType, Offsets);
GV->setInitializer(Init);
+
+ if (RD->hasAttr<DLLImportAttr>())
+ GV->setLinkage(llvm::GlobalVariable::AvailableExternallyLinkage);
}
llvm::Value *MicrosoftCXXABI::performThisAdjustment(CodeGenFunction &CGF,
OpenPOWER on IntegriCloud