[PATCH] D121135: [NFC][Clang][OpaquePtr] Remove calls to Address::deprecated in a couple more files

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 7 09:55:02 PST 2022


ahatanak created this revision.
ahatanak added reviewers: opaque-pointers, rjmccall.
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/D121135

Files:
  clang/lib/CodeGen/CGNonTrivialStruct.cpp
  clang/lib/CodeGen/CGObjC.cpp
  clang/lib/CodeGen/CGObjCGNU.cpp
  clang/lib/CodeGen/CGObjCMac.cpp
  clang/lib/CodeGen/CGObjCRuntime.cpp


Index: clang/lib/CodeGen/CGObjCRuntime.cpp
===================================================================
--- clang/lib/CodeGen/CGObjCRuntime.cpp
+++ clang/lib/CodeGen/CGObjCRuntime.cpp
@@ -106,7 +106,7 @@
                              CGF.CGM.getContext().toBits(StorageSize),
                              CharUnits::fromQuantity(0)));
 
-  Address Addr = Address::deprecated(V, Alignment);
+  Address Addr = Address(V, CGF.Int8Ty, Alignment);
   Addr = CGF.Builder.CreateElementBitCast(Addr,
                                    llvm::Type::getIntNTy(CGF.getLLVMContext(),
                                                          Info->StorageSize));
Index: clang/lib/CodeGen/CGObjCMac.cpp
===================================================================
--- clang/lib/CodeGen/CGObjCMac.cpp
+++ clang/lib/CodeGen/CGObjCMac.cpp
@@ -5272,7 +5272,7 @@
     Entry->setExternallyInitialized(true);
   }
 
-  return Address::deprecated(Entry, Align);
+  return Address(Entry, ObjCTypes.SelectorPtrTy, Align);
 }
 
 llvm::Constant *CGObjCCommonMac::GetClassName(StringRef RuntimeName) {
@@ -7643,7 +7643,7 @@
     CGM.addCompilerUsedGlobal(Entry);
   }
 
-  return Address::deprecated(Entry, Align);
+  return Address(Entry, ObjCTypes.SelectorPtrTy, Align);
 }
 
 /// EmitObjCIvarAssign - Code gen for assigning to a __strong object.
Index: clang/lib/CodeGen/CGObjCGNU.cpp
===================================================================
--- clang/lib/CodeGen/CGObjCGNU.cpp
+++ clang/lib/CodeGen/CGObjCGNU.cpp
@@ -1265,7 +1265,7 @@
                              const std::string &Name,
                              bool isWeak) override {
     return CGF.Builder.CreateLoad(
-        Address::deprecated(GetClassVar(Name, isWeak), CGM.getPointerAlign()));
+        Address(GetClassVar(Name, isWeak), IdTy, CGM.getPointerAlign()));
   }
   int32_t FlagsForOwnership(Qualifiers::ObjCLifetime Ownership) {
     // typedef enum {
Index: clang/lib/CodeGen/CGObjC.cpp
===================================================================
--- clang/lib/CodeGen/CGObjC.cpp
+++ clang/lib/CodeGen/CGObjC.cpp
@@ -3849,7 +3849,7 @@
       getContext().getTypeAlignInChars(TheCXXConstructExpr->getType());
   EmitAggExpr(TheCXXConstructExpr,
               AggValueSlot::forAddr(
-                  Address::deprecated(DV.getScalarVal(), Alignment),
+                  Address(DV.getScalarVal(), ConvertTypeForMem(Ty), Alignment),
                   Qualifiers(), AggValueSlot::IsDestructed,
                   AggValueSlot::DoesNotNeedGCBarriers,
                   AggValueSlot::IsNotAliased, AggValueSlot::DoesNotOverlap));
Index: clang/lib/CodeGen/CGNonTrivialStruct.cpp
===================================================================
--- clang/lib/CodeGen/CGNonTrivialStruct.cpp
+++ clang/lib/CodeGen/CGNonTrivialStruct.cpp
@@ -326,9 +326,9 @@
                                             std::array<CharUnits, N> Alignments,
                                             FunctionArgList Args,
                                             CodeGenFunction *CGF) {
-  return std::array<Address, N>{{Address::deprecated(
-      CGF->Builder.CreateLoad(CGF->GetAddrOfLocalVar(Args[Ints])),
-      Alignments[Ints])...}};
+  return std::array<Address, N>{
+      {Address(CGF->Builder.CreateLoad(CGF->GetAddrOfLocalVar(Args[Ints])),
+               CGF->VoidPtrTy, Alignments[Ints])...}};
 }
 
 // Template classes that are used as bases for classes that emit special


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121135.413535.patch
Type: text/x-patch
Size: 3465 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220307/824025cc/attachment.bin>


More information about the cfe-commits mailing list