aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-09-11 01:21:35 +0000
committerChris Lattner <sabre@nondot.org>2002-09-11 01:21:35 +0000
commit0374b8de2b4a329793287439a9c79d372778230b (patch)
treeda974761a311c0ff1d5098f086a05abe0ace27e9 /lib
parent3cac88ac9e32070d46de011b01e62e316276d527 (diff)
downloadexternal_llvm-0374b8de2b4a329793287439a9c79d372778230b.zip
external_llvm-0374b8de2b4a329793287439a9c79d372778230b.tar.gz
external_llvm-0374b8de2b4a329793287439a9c79d372778230b.tar.bz2
- 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
Diffstat (limited to 'lib')
-rw-r--r--lib/ExecutionEngine/Interpreter/Execution.cpp2
-rw-r--r--lib/Target/SparcV9/SparcV9InstrSelection.cpp15
2 files changed, 3 insertions, 14 deletions
diff --git a/lib/ExecutionEngine/Interpreter/Execution.cpp b/lib/ExecutionEngine/Interpreter/Execution.cpp
index 868bfbe..082823a 100644
--- a/lib/ExecutionEngine/Interpreter/Execution.cpp
+++ b/lib/ExecutionEngine/Interpreter/Execution.cpp
@@ -822,7 +822,7 @@ static GenericValue executeGEPOperation(Value *Ptr, User::op_iterator I,
} else if (const SequentialType *ST = cast<SequentialType>(Ty)) {
// 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;
if (const ArrayType *AT = dyn_cast<ArrayType>(ST))
if (Idx >= AT->getNumElements() && ArrayChecksEnabled) {
diff --git a/lib/Target/SparcV9/SparcV9InstrSelection.cpp b/lib/Target/SparcV9/SparcV9InstrSelection.cpp
index 6c5caaf..ce7e4dc 100644
--- a/lib/Target/SparcV9/SparcV9InstrSelection.cpp
+++ b/lib/Target/SparcV9/SparcV9InstrSelection.cpp
@@ -24,9 +24,6 @@
#include <math.h>
using std::vector;
-//************************* Forward Declarations ***************************/
-
-
//************************ 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
//
@@ -1004,7 +992,8 @@ SetOperandsForMemInstr(vector<MachineInstr*>& mvec,
// offset. (An extra leading zero offset, if any, can be ignored.)
// 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
&& "Array refs must be lowered before Instruction Selection");