[llvm-commits] CVS: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp Interpreter.h
Brian Gaeke
gaeke at cs.uiuc.edu
Fri Nov 7 13:27:01 PST 2003
Changes in directory llvm/lib/ExecutionEngine/Interpreter:
Execution.cpp updated: 1.107 -> 1.108
Interpreter.h updated: 1.48 -> 1.49
---
Log message:
Use CallSites for call sites, instead of CallInsts. A revolutionary concept.
---
Diffs of the changes: (+10 -9)
Index: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
diff -u llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.107 llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.108
--- llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.107 Thu Nov 6 23:22:49 2003
+++ llvm/lib/ExecutionEngine/Interpreter/Execution.cpp Fri Nov 7 13:26:22 2003
@@ -453,10 +453,10 @@
// If we have a previous stack frame, and we have a previous call,
// fill in the return value...
ExecutionContext &CallingSF = ECStack.back();
- if (CallingSF.Caller) {
- if (CallingSF.Caller->getType() != Type::VoidTy) // Save result...
- SetValue(CallingSF.Caller, Result, CallingSF);
- CallingSF.Caller = 0; // We returned from the call...
+ if (CallingSF.Caller.getInstruction()) {
+ if (CallingSF.Caller.getType() != Type::VoidTy) // Save result...
+ SetValue(CallingSF.Caller.getInstruction(), Result, CallingSF);
+ CallingSF.Caller = CallSite(); // We returned from the call...
}
}
}
@@ -639,7 +639,7 @@
void Interpreter::visitCallInst(CallInst &I) {
ExecutionContext &SF = ECStack.back();
- SF.Caller = &I;
+ SF.Caller = CallSite(&I);
std::vector<GenericValue> ArgVals;
ArgVals.reserve(I.getNumOperands()-1);
for (unsigned i = 1; i < I.getNumOperands(); ++i) {
@@ -804,8 +804,8 @@
//
void Interpreter::callFunction(Function *F,
const std::vector<GenericValue> &ArgVals) {
- assert((ECStack.empty() || ECStack.back().Caller == 0 ||
- ECStack.back().Caller->getNumOperands()-1 == ArgVals.size()) &&
+ assert((ECStack.empty() || ECStack.back().Caller.getInstruction() == 0 ||
+ ECStack.back().Caller.arg_size() == ArgVals.size()) &&
"Incorrect number of arguments passed into function call!");
// Make a new stack frame... and fill it in.
ECStack.push_back(ExecutionContext());
Index: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h
diff -u llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:1.48 llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:1.49
--- llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:1.48 Thu Nov 6 23:22:49 2003
+++ llvm/lib/ExecutionEngine/Interpreter/Interpreter.h Fri Nov 7 13:26:23 2003
@@ -18,6 +18,7 @@
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/ExecutionEngine/GenericValue.h"
#include "llvm/Support/InstVisitor.h"
+#include "llvm/Support/CallSite.h"
#include "llvm/Target/TargetData.h"
#include "Support/DataTypes.h"
@@ -64,8 +65,8 @@
BasicBlock::iterator CurInst; // The next instruction to execute
std::map<Value *, GenericValue> Values; // LLVM values used in this invocation
std::vector<GenericValue> VarArgs; // Values passed through an ellipsis
- CallInst *Caller; // Holds the call that called subframes.
- // NULL if main func or debugger invoked fn
+ CallSite Caller; // Holds the call that called subframes.
+ // NULL if main func or debugger invoked fn
AllocaHolderHandle Allocas; // Track memory allocated by alloca
};
More information about the llvm-commits
mailing list