mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-21 02:24:22 +00:00
GetElementPtr instructions default to having no overflow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76222 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1022,6 +1022,9 @@ void GetElementPtrInst::init(Value *Ptr, Value* const *Idx, unsigned NumIdx,
|
|||||||
OL[i+1] = Idx[i];
|
OL[i+1] = Idx[i];
|
||||||
|
|
||||||
setName(Name);
|
setName(Name);
|
||||||
|
|
||||||
|
// GetElementPtr instructions have undefined results on overflow by default.
|
||||||
|
setHasNoPointerOverflow(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetElementPtrInst::init(Value *Ptr, Value *Idx, const std::string &Name) {
|
void GetElementPtrInst::init(Value *Ptr, Value *Idx, const std::string &Name) {
|
||||||
@ -1031,6 +1034,9 @@ void GetElementPtrInst::init(Value *Ptr, Value *Idx, const std::string &Name) {
|
|||||||
OL[1] = Idx;
|
OL[1] = Idx;
|
||||||
|
|
||||||
setName(Name);
|
setName(Name);
|
||||||
|
|
||||||
|
// GetElementPtr instructions have undefined results on overflow by default.
|
||||||
|
setHasNoPointerOverflow(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
GetElementPtrInst::GetElementPtrInst(const GetElementPtrInst &GEPI)
|
GetElementPtrInst::GetElementPtrInst(const GetElementPtrInst &GEPI)
|
||||||
@ -1042,6 +1048,9 @@ GetElementPtrInst::GetElementPtrInst(const GetElementPtrInst &GEPI)
|
|||||||
Use *GEPIOL = GEPI.OperandList;
|
Use *GEPIOL = GEPI.OperandList;
|
||||||
for (unsigned i = 0, E = NumOperands; i != E; ++i)
|
for (unsigned i = 0, E = NumOperands; i != E; ++i)
|
||||||
OL[i] = GEPIOL[i];
|
OL[i] = GEPIOL[i];
|
||||||
|
|
||||||
|
// Transfor the hasNoPointerOverflow() value from the original GEPI.
|
||||||
|
setHasNoPointerOverflow(GEPI.hasNoPointerOverflow());
|
||||||
}
|
}
|
||||||
|
|
||||||
GetElementPtrInst::GetElementPtrInst(Value *Ptr, Value *Idx,
|
GetElementPtrInst::GetElementPtrInst(Value *Ptr, Value *Idx,
|
||||||
|
Reference in New Issue
Block a user