Don't use std::hex.
[oota-llvm.git] / lib / ExecutionEngine / Interpreter / Interpreter.h
index 3007b0adb2a92ef90d4de9e52c92df47db9b2536..323885002ce989c8726cc2b9cb0693024a460e2d 100644 (file)
@@ -17,6 +17,7 @@
 #include "llvm/Function.h"
 #include "llvm/ExecutionEngine/ExecutionEngine.h"
 #include "llvm/ExecutionEngine/GenericValue.h"
+#include "llvm/ADT/APInt.h"
 #include "llvm/Support/InstVisitor.h"
 #include "llvm/Support/CallSite.h"
 #include "llvm/Target/TargetData.h"
@@ -107,7 +108,7 @@ public:
   
   /// create - Create an interpreter ExecutionEngine. This can never fail.
   ///
-  static ExecutionEngine *create(ModuleProvider *M);
+  static ExecutionEngine *create(ModuleProvider *M, std::string *ErrorStr = 0);
 
   /// run - Start execution with the specified function and arguments.
   ///
@@ -165,9 +166,10 @@ public:
   void visitUnwindInst(UnwindInst &I);
   void visitUnreachableInst(UnreachableInst &I);
 
-  void visitShl(ShiftInst &I);
-  void visitLShr(ShiftInst &I);
-  void visitAShr(ShiftInst &I);
+  void visitShl(BinaryOperator &I);
+  void visitLShr(BinaryOperator &I);
+  void visitAShr(BinaryOperator &I);
+
   void visitVAArgInst(VAArgInst &I);
   void visitInstruction(Instruction &I) {
     cerr << I;
@@ -234,17 +236,6 @@ private:  // Helper functions
 
 };
 
-inline void maskToBitWidth(GenericValue& GV, unsigned BitWidth) {
-  uint64_t BitMask = (1ull << BitWidth) - 1;
-  if (BitWidth <= 8)
-    GV.Int8Val &= BitMask;
-  else if (BitWidth <= 16)
-    GV.Int16Val &= BitMask;
-  else if (BitWidth <= 32)
-    GV.Int32Val &= BitMask;
-  else 
-    GV.Int64Val &= BitMask;
-}
 } // End llvm namespace
 
 #endif