mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
- Change getelementptr instruction to use long indexes instead of uint
indexes for sequential types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3683 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3cac88ac9e
commit
0374b8de2b
@ -822,7 +822,7 @@ static GenericValue executeGEPOperation(Value *Ptr, User::op_iterator I,
|
|||||||
} else if (const SequentialType *ST = cast<SequentialType>(Ty)) {
|
} else if (const SequentialType *ST = cast<SequentialType>(Ty)) {
|
||||||
|
|
||||||
// Get the index number for the array... which must be uint type...
|
// Get the index number for the array... which must be uint type...
|
||||||
assert((*I)->getType() == Type::UIntTy);
|
assert((*I)->getType() == Type::LongTy);
|
||||||
unsigned Idx = getOperandValue(*I, SF).UIntVal;
|
unsigned Idx = getOperandValue(*I, SF).UIntVal;
|
||||||
if (const ArrayType *AT = dyn_cast<ArrayType>(ST))
|
if (const ArrayType *AT = dyn_cast<ArrayType>(ST))
|
||||||
if (Idx >= AT->getNumElements() && ArrayChecksEnabled) {
|
if (Idx >= AT->getNumElements() && ArrayChecksEnabled) {
|
||||||
|
@ -24,9 +24,6 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
using std::vector;
|
using std::vector;
|
||||||
|
|
||||||
//************************* Forward Declarations ***************************/
|
|
||||||
|
|
||||||
|
|
||||||
//************************ Internal Functions ******************************/
|
//************************ Internal Functions ******************************/
|
||||||
|
|
||||||
|
|
||||||
@ -937,15 +934,6 @@ CreateCodeForFixedSizeAlloca(const TargetMachine& target,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Check for a constant (uint) 0.
|
|
||||||
inline bool
|
|
||||||
IsZero(Value* idx)
|
|
||||||
{
|
|
||||||
return (isa<ConstantInt>(idx) && cast<ConstantInt>(idx)->isNullValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
// Function SetOperandsForMemInstr
|
// Function SetOperandsForMemInstr
|
||||||
//
|
//
|
||||||
@ -1004,7 +992,8 @@ SetOperandsForMemInstr(vector<MachineInstr*>& mvec,
|
|||||||
// offset. (An extra leading zero offset, if any, can be ignored.)
|
// offset. (An extra leading zero offset, if any, can be ignored.)
|
||||||
// Generate code sequence to compute address from index.
|
// Generate code sequence to compute address from index.
|
||||||
//
|
//
|
||||||
bool firstIdxIsZero = IsZero(idxVec[0]);
|
bool firstIdxIsZero =
|
||||||
|
(idxVec[0] == Constant::getNullValue(idxVec[0]->getType()));
|
||||||
assert(idxVec.size() == 1U + firstIdxIsZero
|
assert(idxVec.size() == 1U + firstIdxIsZero
|
||||||
&& "Array refs must be lowered before Instruction Selection");
|
&& "Array refs must be lowered before Instruction Selection");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user