summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-08-22 22:49:05 +0000
committerChris Lattner <sabre@nondot.org>2002-08-22 22:49:05 +0000
commitcd709cbf53cc33486f06e4e38f29fac87205def5 (patch)
tree1b428d677e5c0b3751272cc97faebd73cc1190ff /llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
parent030effa42ca55f9bc37e542b8e06e8abf4ea730c (diff)
downloadbcm5719-llvm-cd709cbf53cc33486f06e4e38f29fac87205def5.tar.gz
bcm5719-llvm-cd709cbf53cc33486f06e4e38f29fac87205def5.zip
Load & StoreInst no longer derive from MemAccessInst, so we don't have
to handle indexing anymore llvm-svn: 3485
Diffstat (limited to 'llvm/lib/ExecutionEngine/Interpreter/Execution.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/Interpreter/Execution.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
index 7bf276a7606..7b5a63ead07 100644
--- a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
+++ b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
@@ -765,9 +765,9 @@ static void executeFreeInst(FreeInst &I, ExecutionContext &SF) {
}
-// getElementOffset - The workhorse for getelementptr, load and store. This
-// function returns the offset that arguments ArgOff+1 -> NumArgs specify for
-// the pointer type specified by argument Arg.
+// getElementOffset - The workhorse for getelementptr. This function returns
+// the offset that arguments ArgOff+1 -> NumArgs specify for the pointer type
+// specified by argument Arg.
//
static PointerTy getElementOffset(MemAccessInst &I, ExecutionContext &SF) {
assert(isa<PointerType>(I.getPointerOperand()->getType()) &&
@@ -832,11 +832,7 @@ static void executeGEPInst(GetElementPtrInst &I, ExecutionContext &SF) {
static void executeLoadInst(LoadInst &I, ExecutionContext &SF) {
GenericValue SRC = getOperandValue(I.getPointerOperand(), SF);
- PointerTy SrcPtr = SRC.PointerVal;
- PointerTy Offset = getElementOffset(I, SF); // Handle any structure indices
- SrcPtr += Offset;
-
- GenericValue *Ptr = (GenericValue*)SrcPtr;
+ GenericValue *Ptr = (GenericValue*)SRC.PointerVal;
GenericValue Result;
switch (I.getType()->getPrimitiveID()) {
@@ -861,10 +857,7 @@ static void executeLoadInst(LoadInst &I, ExecutionContext &SF) {
static void executeStoreInst(StoreInst &I, ExecutionContext &SF) {
GenericValue SRC = getOperandValue(I.getPointerOperand(), SF);
- PointerTy SrcPtr = SRC.PointerVal;
- SrcPtr += getElementOffset(I, SF); // Handle any structure indices
-
- GenericValue *Ptr = (GenericValue *)SrcPtr;
+ GenericValue *Ptr = (GenericValue *)SRC.PointerVal;
GenericValue Val = getOperandValue(I.getOperand(0), SF);
switch (I.getOperand(0)->getType()->getPrimitiveID()) {
OpenPOWER on IntegriCloud