This revision was automatically updated to reflect the committed changes.
Closed by commit rGaa4ea0ee5441: [NFC][Clang][OpaquePtr] Remove calls to 
Address::deprecated in a couple (authored by ahatanak).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121135/new/

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


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
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to