aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGClass.cpp
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2021-07-17 16:17:39 +0200
committerNikita Popov <nikita.ppv@gmail.com>2021-07-17 16:42:10 +0200
commit4737eebc0d05a42bd5a27e325d3846bd90a4d1b5 (patch)
tree90701cd8805fe581a47242f63510e11cdcc9335d /clang/lib/CodeGen/CGClass.cpp
parent7db463ced55a481a4693c8da1d413606c97fab9e (diff)
downloadllvm-4737eebc0d05a42bd5a27e325d3846bd90a4d1b5.zip
llvm-4737eebc0d05a42bd5a27e325d3846bd90a4d1b5.tar.gz
llvm-4737eebc0d05a42bd5a27e325d3846bd90a4d1b5.tar.bz2
[OpaquePtr] Remove uses of CreateConstInBoundsGEP2_64() without type
Remove uses of to-be-deprecated API.
Diffstat (limited to 'clang/lib/CodeGen/CGClass.cpp')
-rw-r--r--clang/lib/CodeGen/CGClass.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CGClass.cpp b/clang/lib/CodeGen/CGClass.cpp
index 3551c5e..19fae76 100644
--- a/clang/lib/CodeGen/CGClass.cpp
+++ b/clang/lib/CodeGen/CGClass.cpp
@@ -467,8 +467,6 @@ llvm::Value *CodeGenFunction::GetVTTParameter(GlobalDecl GD,
const CXXRecordDecl *RD = cast<CXXMethodDecl>(CurCodeDecl)->getParent();
const CXXRecordDecl *Base = cast<CXXMethodDecl>(GD.getDecl())->getParent();
- llvm::Value *VTT;
-
uint64_t SubVTTIndex;
if (Delegating) {
@@ -494,15 +492,14 @@ llvm::Value *CodeGenFunction::GetVTTParameter(GlobalDecl GD,
if (CGM.getCXXABI().NeedsVTTParameter(CurGD)) {
// A VTT parameter was passed to the constructor, use it.
- VTT = LoadCXXVTT();
- VTT = Builder.CreateConstInBoundsGEP1_64(VTT, SubVTTIndex);
+ llvm::Value *VTT = LoadCXXVTT();
+ return Builder.CreateConstInBoundsGEP1_64(VTT, SubVTTIndex);
} else {
// We're the complete constructor, so get the VTT by name.
- VTT = CGM.getVTables().GetAddrOfVTT(RD);
- VTT = Builder.CreateConstInBoundsGEP2_64(VTT, 0, SubVTTIndex);
+ llvm::GlobalValue *VTT = CGM.getVTables().GetAddrOfVTT(RD);
+ return Builder.CreateConstInBoundsGEP2_64(
+ VTT->getValueType(), VTT, 0, SubVTTIndex);
}
-
- return VTT;
}
namespace {