diff options
author | Nikita Popov <npopov@redhat.com> | 2022-02-16 16:38:11 +0100 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2022-02-17 11:26:42 +0100 |
commit | 5065076698cf32b5ad3b6f88b5f3b84d68948589 (patch) | |
tree | 408357fbb628e80958a4e954a3e3495f357d71c5 /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 093ecccdab47640c5d94ace7ad440972f19f66a9 (diff) | |
download | llvm-5065076698cf32b5ad3b6f88b5f3b84d68948589.zip llvm-5065076698cf32b5ad3b6f88b5f3b84d68948589.tar.gz llvm-5065076698cf32b5ad3b6f88b5f3b84d68948589.tar.bz2 |
[CodeGen] Rename deprecated Address constructor
To make uses of the deprecated constructor easier to spot, and to
ensure that no new uses are introduced, rename it to
Address::deprecated().
While doing the rename, I've filled in element types in cases
where it was relatively obvious, but we're still left with 135
calls to the deprecated constructor.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index a7f62b4..95091ed 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -593,7 +593,7 @@ CodeGenFunction::DecodeAddrUsedInPrologue(llvm::Value *F, auto *GOTAddr = Builder.CreateIntToPtr(GOTAsInt, Int8PtrPtrTy, "global_addr"); // Load the original pointer through the global. - return Builder.CreateLoad(Address(GOTAddr, getPointerAlign()), + return Builder.CreateLoad(Address(GOTAddr, Int8PtrTy, getPointerAlign()), "decoded_addr"); } @@ -1102,9 +1102,9 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy, EI->getType()->getPointerElementType(), &*EI, Idx); llvm::Type *Ty = cast<llvm::GetElementPtrInst>(Addr)->getResultElementType(); - ReturnValuePointer = Address(Addr, getPointerAlign()); + ReturnValuePointer = Address::deprecated(Addr, getPointerAlign()); Addr = Builder.CreateAlignedLoad(Ty, Addr, getPointerAlign(), "agg.result"); - ReturnValue = Address(Addr, CGM.getNaturalTypeAlignment(RetTy)); + ReturnValue = Address::deprecated(Addr, CGM.getNaturalTypeAlignment(RetTy)); } else { ReturnValue = CreateIRTemp(RetTy, "retval"); @@ -1929,7 +1929,7 @@ static void emitNonZeroVLAInit(CodeGenFunction &CGF, QualType baseType, dest.getAlignment().alignmentOfArrayElement(baseSize); // memcpy the individual element bit-pattern. - Builder.CreateMemCpy(Address(cur, curAlign), src, baseSizeInChars, + Builder.CreateMemCpy(Address(cur, CGF.Int8Ty, curAlign), src, baseSizeInChars, /*volatile*/ false); // Go to the next element. @@ -2002,7 +2002,7 @@ CodeGenFunction::EmitNullInitialization(Address DestPtr, QualType Ty) { CharUnits NullAlign = DestPtr.getAlignment(); NullVariable->setAlignment(NullAlign.getAsAlign()); Address SrcPtr(Builder.CreateBitCast(NullVariable, Builder.getInt8PtrTy()), - NullAlign); + Builder.getInt8Ty(), NullAlign); if (vla) return emitNonZeroVLAInit(*this, Ty, DestPtr, SrcPtr, SizeVal); @@ -2480,7 +2480,7 @@ Address CodeGenFunction::EmitFieldAnnotations(const FieldDecl *D, V = Builder.CreateBitCast(V, VTy); } - return Address(V, Addr.getAlignment()); + return Address::deprecated(V, Addr.getAlignment()); } CodeGenFunction::CGCapturedStmtInfo::~CGCapturedStmtInfo() { } |