mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
[opaque pointer type] More GEP IRBuilder API migrations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234064 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8431785c5e
commit
f259550935
@ -1068,12 +1068,16 @@ public:
|
||||
return Insert(GetElementPtrInst::CreateInBounds(Ty, Ptr, Idx), Name);
|
||||
}
|
||||
Value *CreateConstGEP1_32(Value *Ptr, unsigned Idx0, const Twine &Name = "") {
|
||||
return CreateConstGEP1_32(nullptr, Ptr, Idx0, Name);
|
||||
}
|
||||
Value *CreateConstGEP1_32(Type *Ty, Value *Ptr, unsigned Idx0,
|
||||
const Twine &Name = "") {
|
||||
Value *Idx = ConstantInt::get(Type::getInt32Ty(Context), Idx0);
|
||||
|
||||
if (Constant *PC = dyn_cast<Constant>(Ptr))
|
||||
return Insert(Folder.CreateGetElementPtr(nullptr, PC, Idx), Name);
|
||||
return Insert(Folder.CreateGetElementPtr(Ty, PC, Idx), Name);
|
||||
|
||||
return Insert(GetElementPtrInst::Create(nullptr, Ptr, Idx), Name);
|
||||
return Insert(GetElementPtrInst::Create(Ty, Ptr, Idx), Name);
|
||||
}
|
||||
Value *CreateConstInBoundsGEP1_32(Value *Ptr, unsigned Idx0,
|
||||
const Twine &Name = "") {
|
||||
|
@ -1214,7 +1214,8 @@ void DFSanFunction::storeShadow(Value *Addr, uint64_t Size, uint64_t Align,
|
||||
Value *ShadowVecAddr =
|
||||
IRB.CreateBitCast(ShadowAddr, PointerType::getUnqual(ShadowVecTy));
|
||||
do {
|
||||
Value *CurShadowVecAddr = IRB.CreateConstGEP1_32(ShadowVecAddr, Offset);
|
||||
Value *CurShadowVecAddr =
|
||||
IRB.CreateConstGEP1_32(ShadowVecTy, ShadowVecAddr, Offset);
|
||||
IRB.CreateAlignedStore(ShadowVec, CurShadowVecAddr, ShadowAlign);
|
||||
Size -= ShadowVecSize;
|
||||
++Offset;
|
||||
@ -1222,7 +1223,8 @@ void DFSanFunction::storeShadow(Value *Addr, uint64_t Size, uint64_t Align,
|
||||
Offset *= ShadowVecSize;
|
||||
}
|
||||
while (Size > 0) {
|
||||
Value *CurShadowAddr = IRB.CreateConstGEP1_32(ShadowAddr, Offset);
|
||||
Value *CurShadowAddr =
|
||||
IRB.CreateConstGEP1_32(DFS.ShadowTy, ShadowAddr, Offset);
|
||||
IRB.CreateAlignedStore(Shadow, CurShadowAddr, ShadowAlign);
|
||||
--Size;
|
||||
++Offset;
|
||||
|
@ -623,8 +623,8 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
|
||||
Value *IntptrOriginPtr =
|
||||
IRB.CreatePointerCast(OriginPtr, PointerType::get(MS.IntptrTy, 0));
|
||||
for (unsigned i = 0; i < Size / IntptrSize; ++i) {
|
||||
Value *Ptr =
|
||||
i ? IRB.CreateConstGEP1_32(IntptrOriginPtr, i) : IntptrOriginPtr;
|
||||
Value *Ptr = i ? IRB.CreateConstGEP1_32(MS.IntptrTy, IntptrOriginPtr, i)
|
||||
: IntptrOriginPtr;
|
||||
IRB.CreateAlignedStore(IntptrOrigin, Ptr, CurrentAlignment);
|
||||
Ofs += IntptrSize / kOriginSize;
|
||||
CurrentAlignment = IntptrAlignment;
|
||||
@ -632,7 +632,8 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
|
||||
}
|
||||
|
||||
for (unsigned i = Ofs; i < (Size + kOriginSize - 1) / kOriginSize; ++i) {
|
||||
Value *GEP = i ? IRB.CreateConstGEP1_32(OriginPtr, i) : OriginPtr;
|
||||
Value *GEP =
|
||||
i ? IRB.CreateConstGEP1_32(nullptr, OriginPtr, i) : OriginPtr;
|
||||
IRB.CreateAlignedStore(Origin, GEP, CurrentAlignment);
|
||||
CurrentAlignment = kMinOriginAlignment;
|
||||
}
|
||||
@ -2843,7 +2844,8 @@ struct VarArgAMD64Helper : public VarArgHelper {
|
||||
Value *OverflowArgAreaPtr = IRB.CreateLoad(OverflowArgAreaPtrPtr);
|
||||
Value *OverflowArgAreaShadowPtr =
|
||||
MSV.getShadowPtr(OverflowArgAreaPtr, IRB.getInt8Ty(), IRB);
|
||||
Value *SrcPtr = IRB.CreateConstGEP1_32(VAArgTLSCopy, AMD64FpEndOffset);
|
||||
Value *SrcPtr = IRB.CreateConstGEP1_32(IRB.getInt8Ty(), VAArgTLSCopy,
|
||||
AMD64FpEndOffset);
|
||||
IRB.CreateMemCpy(OverflowArgAreaShadowPtr, SrcPtr, VAArgOverflowSize, 16);
|
||||
}
|
||||
}
|
||||
|
@ -213,7 +213,7 @@ Value *Scatterer::operator[](unsigned I) {
|
||||
CV[0] = Builder.CreateBitCast(V, Ty, V->getName() + ".i0");
|
||||
}
|
||||
if (I != 0)
|
||||
CV[I] = Builder.CreateConstGEP1_32(CV[0], I,
|
||||
CV[I] = Builder.CreateConstGEP1_32(nullptr, CV[0], I,
|
||||
V->getName() + ".i" + Twine(I));
|
||||
} else {
|
||||
// Search through a chain of InsertElementInsts looking for element I.
|
||||
|
Loading…
Reference in New Issue
Block a user