[PATCH] D121153: [NFC][Clang][OpaquePtr] Remove calls to Address::deprecated in CGBuiltin.cpp
Akira Hatanaka via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 7 13:02:06 PST 2022
ahatanak created this revision.
ahatanak added a reviewer: opaque-pointers.
ahatanak added a project: clang.
Herald added a project: All.
ahatanak requested review of this revision.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D121153
Files:
clang/lib/CodeGen/CGBuiltin.cpp
Index: clang/lib/CodeGen/CGBuiltin.cpp
===================================================================
--- clang/lib/CodeGen/CGBuiltin.cpp
+++ clang/lib/CodeGen/CGBuiltin.cpp
@@ -1778,8 +1778,9 @@
auto AL = ApplyDebugLocation::CreateArtificial(*this);
CharUnits Offset;
- Address BufAddr = Address::deprecated(
- Builder.CreateLoad(GetAddrOfLocalVar(Args[0]), "buf"), BufferAlignment);
+ Address BufAddr =
+ Address(Builder.CreateLoad(GetAddrOfLocalVar(Args[0]), "buf"), Int8Ty,
+ BufferAlignment);
Builder.CreateStore(Builder.getInt8(Layout.getSummaryByte()),
Builder.CreateConstByteGEP(BufAddr, Offset++, "summary"));
Builder.CreateStore(Builder.getInt8(Layout.getNumArgsByte()),
@@ -2108,7 +2109,8 @@
? Types[Context.VoidPtrTy]
: Types[CanonicalType];
- Address FieldAddress = Address::deprecated(FieldPtr, Align);
+ Address FieldAddress =
+ Address(FieldPtr, CGF.ConvertTypeForMem(FD->getType()), Align);
FieldPtr = CGF.Builder.CreateLoad(FieldAddress);
// FIXME Need to handle bitfield here
@@ -9598,7 +9600,7 @@
llvm::Value *ValOffsetPtr =
Builder.CreateGEP(Int64Ty, ValPtr, Builder.getInt32(i));
Address Addr =
- Address::deprecated(ValOffsetPtr, CharUnits::fromQuantity(8));
+ Address(ValOffsetPtr, Int64Ty, CharUnits::fromQuantity(8));
ToRet = Builder.CreateStore(Builder.CreateExtractValue(Val, i), Addr);
}
return ToRet;
@@ -9611,7 +9613,7 @@
llvm::Value *ValOffsetPtr =
Builder.CreateGEP(Int64Ty, ValPtr, Builder.getInt32(i));
Address Addr =
- Address::deprecated(ValOffsetPtr, CharUnits::fromQuantity(8));
+ Address(ValOffsetPtr, Int64Ty, CharUnits::fromQuantity(8));
Args.push_back(Builder.CreateLoad(Addr));
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121153.413605.patch
Type: text/x-patch
Size: 1925 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220307/cb15d53d/attachment.bin>
More information about the cfe-commits
mailing list