Skip to content

Commit

Permalink
[OpaquePtr] Remove uses of CreateConstInBoundsGEP2_64() without type
Browse files Browse the repository at this point in the history
Remove uses of to-be-deprecated API.
  • Loading branch information
nikic committed Jul 17, 2021
1 parent 7db463c commit 4737eeb
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions clang/lib/CodeGen/CGClass.cpp
Expand Up @@ -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) {
Expand All @@ -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 {
Expand Down

0 comments on commit 4737eeb

Please sign in to comment.