diff options
-rw-r--r-- | include/llvm/ExecutionEngine/ExecutionEngine.h | 7 | ||||
-rw-r--r-- | lib/ExecutionEngine/Interpreter/Execution.cpp | 6 | ||||
-rw-r--r-- | lib/ExecutionEngine/Interpreter/Interpreter.h | 3 |
3 files changed, 9 insertions, 7 deletions
diff --git a/include/llvm/ExecutionEngine/ExecutionEngine.h b/include/llvm/ExecutionEngine/ExecutionEngine.h index fdb219d..98d9dae 100644 --- a/include/llvm/ExecutionEngine/ExecutionEngine.h +++ b/include/llvm/ExecutionEngine/ExecutionEngine.h @@ -75,14 +75,13 @@ public: // virtual void *getPointerToFunction(Function *F) = 0; + void StoreValueToMemory(GenericValue Val, GenericValue *Ptr, const Type *Ty); + void InitializeMemory(const Constant *Init, void *Addr); + protected: void emitGlobals(); - -public: // FIXME: protected: // API shared among subclasses GenericValue getConstantValue(const Constant *C); - void StoreValueToMemory(GenericValue Val, GenericValue *Ptr, const Type *Ty); GenericValue LoadValueFromMemory(GenericValue *Ptr, const Type *Ty); - void InitializeMemory(const Constant *Init, void *Addr); }; #endif diff --git a/lib/ExecutionEngine/Interpreter/Execution.cpp b/lib/ExecutionEngine/Interpreter/Execution.cpp index 80a0677..4570f1a 100644 --- a/lib/ExecutionEngine/Interpreter/Execution.cpp +++ b/lib/ExecutionEngine/Interpreter/Execution.cpp @@ -77,7 +77,7 @@ static GenericValue executeAddInst(GenericValue Src1, GenericValue Src2, const Type *Ty); -static GenericValue getOperandValue(Value *V, ExecutionContext &SF) { +GenericValue Interpreter::getOperandValue(Value *V, ExecutionContext &SF) { if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) { switch (CE->getOpcode()) { case Instruction::Cast: @@ -840,8 +840,8 @@ void Interpreter::visitShr(ShiftInst &I) { IMPLEMENT_CAST_CASE_FP_IMP(DESTTY, DESTCTY); \ IMPLEMENT_CAST_CASE_END() -static GenericValue executeCastOperation(Value *SrcVal, const Type *Ty, - ExecutionContext &SF) { +GenericValue Interpreter::executeCastOperation(Value *SrcVal, const Type *Ty, + ExecutionContext &SF) { const Type *SrcTy = SrcVal->getType(); GenericValue Dest, Src = getOperandValue(SrcVal, SF); diff --git a/lib/ExecutionEngine/Interpreter/Interpreter.h b/lib/ExecutionEngine/Interpreter/Interpreter.h index ef0540c..a59ebad 100644 --- a/lib/ExecutionEngine/Interpreter/Interpreter.h +++ b/lib/ExecutionEngine/Interpreter/Interpreter.h @@ -159,6 +159,9 @@ private: // Helper functions void initializeExecutionEngine(); void initializeExternalFunctions(); + GenericValue getOperandValue(Value *V, ExecutionContext &SF); + GenericValue executeCastOperation(Value *SrcVal, const Type *Ty, + ExecutionContext &SF); }; #endif |