diff options
author | David Blaikie <dblaikie@gmail.com> | 2015-04-02 18:55:21 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2015-04-02 18:55:21 +0000 |
commit | e3b172afc33004cb11299e21dbea1dbb4cc4dc27 (patch) | |
tree | 2da7994df7369352010a32f0c0c489f7c8c19ea7 /clang/lib/CodeGen/MicrosoftCXXABI.cpp | |
parent | a64723c2bf3a6dade77aa9b87046ec1e72b0a669 (diff) | |
download | bcm5719-llvm-e3b172afc33004cb11299e21dbea1dbb4cc4dc27.tar.gz bcm5719-llvm-e3b172afc33004cb11299e21dbea1dbb4cc4dc27.zip |
[opaque pointer type] Update for GEP API changes in LLVM
Now the GEP constant utility functions require the type to be explicitly
passed (since eventually the pointer type will be opaque and not convey
the required type information). For now callers can still pass nullptr
(though none were needed here in Clang, which is nice) if
convenienc/necessary, but eventually that will be disallowed as well.
llvm-svn: 233937
Diffstat (limited to 'clang/lib/CodeGen/MicrosoftCXXABI.cpp')
-rw-r--r-- | clang/lib/CodeGen/MicrosoftCXXABI.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/MicrosoftCXXABI.cpp b/clang/lib/CodeGen/MicrosoftCXXABI.cpp index b8089edd704..a5e3f665ee5 100644 --- a/clang/lib/CodeGen/MicrosoftCXXABI.cpp +++ b/clang/lib/CodeGen/MicrosoftCXXABI.cpp @@ -1550,8 +1550,8 @@ llvm::GlobalVariable *MicrosoftCXXABI::getAddrOfVTable(const CXXRecordDecl *RD, llvm::ConstantInt::get(CGM.IntTy, 1)}; // Create a GEP which points just after the first entry in the VFTable, // this should be the location of the first virtual method. - llvm::Constant *VTableGEP = - llvm::ConstantExpr::getInBoundsGetElementPtr(VTable, GEPIndices); + llvm::Constant *VTableGEP = llvm::ConstantExpr::getInBoundsGetElementPtr( + VTable->getValueType(), VTable, GEPIndices); if (llvm::GlobalValue::isWeakForLinker(VFTableLinkage)) { VFTableLinkage = llvm::GlobalValue::ExternalLinkage; if (C) @@ -3020,13 +3020,15 @@ llvm::GlobalVariable *MSRTTIBuilder::getClassHierarchyDescriptor() { if (CHD->isWeakForLinker()) CHD->setComdat(CGM.getModule().getOrInsertComdat(CHD->getName())); + auto *Bases = getBaseClassArray(Classes); + // Initialize the base class ClassHierarchyDescriptor. llvm::Constant *Fields[] = { llvm::ConstantInt::get(CGM.IntTy, 0), // Unknown llvm::ConstantInt::get(CGM.IntTy, Flags), llvm::ConstantInt::get(CGM.IntTy, Classes.size()), ABI.getImageRelativeConstant(llvm::ConstantExpr::getInBoundsGetElementPtr( - getBaseClassArray(Classes), + Bases->getValueType(), Bases, llvm::ArrayRef<llvm::Value *>(GEPIndices))), }; CHD->setInitializer(llvm::ConstantStruct::get(Type, Fields)); |