Make getOperandValue and executeCastOperation methods of Interpreter.
authorBrian Gaeke <gaeke@uiuc.edu>
Fri, 5 Sep 2003 18:55:03 +0000 (18:55 +0000)
committerBrian Gaeke <gaeke@uiuc.edu>
Fri, 5 Sep 2003 18:55:03 +0000 (18:55 +0000)
This lets us protect a few more ExecutionEngine methods.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8367 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ExecutionEngine/ExecutionEngine.h
lib/ExecutionEngine/Interpreter/Execution.cpp
lib/ExecutionEngine/Interpreter/Interpreter.h

index fdb219df66fcb650c7d5c7a577f0448ec407b882..98d9daedac0c8abb1778182b4461bbd3c258a03b 100644 (file)
@@ -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
index 80a0677a37ee224240b4538c575639c924f8a2e1..4570f1a239e4c140a9131ffb913a2fb1ce044517 100644 (file)
@@ -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);
 
index ef0540c1fed5bf53df437ec40bb6c4ca5874eb2e..a59ebade36fe124f743ad30c397e42f4a3952240 100644 (file)
@@ -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