[clang] aa4ea0e - [NFC][Clang][OpaquePtr] Remove calls to Address::deprecated in a couple
Akira Hatanaka via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 11 09:30:37 PST 2022
Author: Akira Hatanaka
Date: 2022-03-11T09:30:31-08:00
New Revision: aa4ea0ee54411d12d17dd6261f64726913f15e16
URL: https://github.com/llvm/llvm-project/commit/aa4ea0ee54411d12d17dd6261f64726913f15e16
DIFF: https://github.com/llvm/llvm-project/commit/aa4ea0ee54411d12d17dd6261f64726913f15e16.diff
LOG: [NFC][Clang][OpaquePtr] Remove calls to Address::deprecated in a couple
more files
Differential Revision: https://reviews.llvm.org/D121135
Added:
Modified:
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
Removed:
################################################################################
diff --git a/clang/lib/CodeGen/CGNonTrivialStruct.cpp b/clang/lib/CodeGen/CGNonTrivialStruct.cpp
index eff768ead9580..9b1ae12964aca 100644
--- a/clang/lib/CodeGen/CGNonTrivialStruct.cpp
+++ b/clang/lib/CodeGen/CGNonTrivialStruct.cpp
@@ -326,9 +326,9 @@ static std::array<Address, N> getParamAddrs(std::index_sequence<Ints...> IntSeq,
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
diff --git a/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp
index 51343ca3dbe30..77aa1f5b53d40 100644
--- a/clang/lib/CodeGen/CGObjC.cpp
+++ b/clang/lib/CodeGen/CGObjC.cpp
@@ -3849,7 +3849,7 @@ CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(
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));
diff --git a/clang/lib/CodeGen/CGObjCGNU.cpp b/clang/lib/CodeGen/CGObjCGNU.cpp
index a0f9e32d4f81d..210bbf36d7bdf 100644
--- a/clang/lib/CodeGen/CGObjCGNU.cpp
+++ b/clang/lib/CodeGen/CGObjCGNU.cpp
@@ -1265,7 +1265,7 @@ class CGObjCGNUstep2 : public CGObjCGNUstep {
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 {
diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp
index 7e4176e63ecd0..cbd7e82e60bd2 100644
--- a/clang/lib/CodeGen/CGObjCMac.cpp
+++ b/clang/lib/CodeGen/CGObjCMac.cpp
@@ -5272,7 +5272,7 @@ Address CGObjCMac::EmitSelectorAddr(Selector Sel) {
Entry->setExternallyInitialized(true);
}
- return Address::deprecated(Entry, Align);
+ return Address(Entry, ObjCTypes.SelectorPtrTy, Align);
}
llvm::Constant *CGObjCCommonMac::GetClassName(StringRef RuntimeName) {
@@ -7643,7 +7643,7 @@ Address CGObjCNonFragileABIMac::EmitSelectorAddr(Selector Sel) {
CGM.addCompilerUsedGlobal(Entry);
}
- return Address::deprecated(Entry, Align);
+ return Address(Entry, ObjCTypes.SelectorPtrTy, Align);
}
/// EmitObjCIvarAssign - Code gen for assigning to a __strong object.
diff --git a/clang/lib/CodeGen/CGObjCRuntime.cpp b/clang/lib/CodeGen/CGObjCRuntime.cpp
index 80cabbe930017..550fd3d70bdcc 100644
--- a/clang/lib/CodeGen/CGObjCRuntime.cpp
+++ b/clang/lib/CodeGen/CGObjCRuntime.cpp
@@ -106,7 +106,7 @@ LValue CGObjCRuntime::EmitValueForIvarAtOffset(CodeGen::CodeGenFunction &CGF,
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));
More information about the cfe-commits
mailing list