[OpaquePtr] Remove uses of CreateConstGEP1_64() without element type
authorNikita Popov <nikita.ppv@gmail.com>
Sat, 17 Jul 2021 14:38:43 +0000 (16:38 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Sat, 17 Jul 2021 14:43:20 +0000 (16:43 +0200)
Remove uses of to-be-deprecated API.

clang/lib/CodeGen/CGAtomic.cpp
clang/lib/CodeGen/ItaniumCXXABI.cpp
llvm/lib/Target/AMDGPU/AMDGPULateCodeGenPrepare.cpp

index e5c5e5b..b6722ad 100644 (file)
@@ -85,7 +85,7 @@ namespace {
             (C.toCharUnitsFromBits(OrigBFI.Offset) / lvalue.getAlignment()) *
             lvalue.getAlignment();
         VoidPtrAddr = CGF.Builder.CreateConstGEP1_64(
-            VoidPtrAddr, OffsetInChars.getQuantity());
+            CGF.Int8Ty, VoidPtrAddr, OffsetInChars.getQuantity());
         auto Addr = CGF.Builder.CreatePointerBitCastOrAddrSpaceCast(
             VoidPtrAddr,
             CGF.Builder.getIntNTy(AtomicSizeInBits)->getPointerTo(),
index 697feaf..8d355a8 100644 (file)
@@ -1576,8 +1576,9 @@ ItaniumCXXABI::GetVirtualBaseClassOffset(CodeGenFunction &CGF,
       CGM.getItaniumVTableContext().getVirtualBaseOffsetOffset(ClassDecl,
                                                                BaseClassDecl);
   llvm::Value *VBaseOffsetPtr =
-    CGF.Builder.CreateConstGEP1_64(VTablePtr, VBaseOffsetOffset.getQuantity(),
-                                   "vbase.offset.ptr");
+    CGF.Builder.CreateConstGEP1_64(
+        CGF.Int8Ty, VTablePtr, VBaseOffsetOffset.getQuantity(),
+        "vbase.offset.ptr");
 
   llvm::Value *VBaseOffset;
   if (CGM.getItaniumVTableContext().isRelativeLayout()) {
index e57d971..4971b01 100644 (file)
@@ -165,8 +165,10 @@ bool AMDGPULateCodeGenPrepare::visitLoadInst(LoadInst &LI) {
   PointerType *Int32PtrTy = Type::getInt32PtrTy(LI.getContext(), AS);
   PointerType *Int8PtrTy = Type::getInt8PtrTy(LI.getContext(), AS);
   auto *NewPtr = IRB.CreateBitCast(
-      IRB.CreateConstGEP1_64(IRB.CreatePointerBitCastOrAddrSpaceCast(Base, Int8PtrTy),
-                             Offset - Adjust),
+      IRB.CreateConstGEP1_64(
+          IRB.getInt8Ty(),
+          IRB.CreatePointerBitCastOrAddrSpaceCast(Base, Int8PtrTy),
+          Offset - Adjust),
       Int32PtrTy);
   LoadInst *NewLd = IRB.CreateAlignedLoad(IRB.getInt32Ty(), NewPtr, Align(4));
   NewLd->copyMetadata(LI);