Chris Lattner | 92101ac | 2001-08-23 17:05:04 +0000 | [diff] [blame] | 1 | //===-- Interpreter.h ------------------------------------------*- C++ -*--===// |
Misha Brukman | d1c881a | 2005-04-21 22:43:08 +0000 | [diff] [blame] | 2 | // |
John Criswell | 856ba76 | 2003-10-21 15:17:13 +0000 | [diff] [blame] | 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | 4ee451d | 2007-12-29 20:36:04 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Misha Brukman | d1c881a | 2005-04-21 22:43:08 +0000 | [diff] [blame] | 7 | // |
John Criswell | 856ba76 | 2003-10-21 15:17:13 +0000 | [diff] [blame] | 8 | //===----------------------------------------------------------------------===// |
Chris Lattner | 92101ac | 2001-08-23 17:05:04 +0000 | [diff] [blame] | 9 | // |
| 10 | // This header file defines the interpreter structure |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
Stephen Hines | 37ed9c1 | 2014-12-01 14:51:49 -0800 | [diff] [blame^] | 14 | #ifndef LLVM_LIB_EXECUTIONENGINE_INTERPRETER_INTERPRETER_H |
| 15 | #define LLVM_LIB_EXECUTIONENGINE_INTERPRETER_INTERPRETER_H |
Chris Lattner | 92101ac | 2001-08-23 17:05:04 +0000 | [diff] [blame] | 16 | |
Brian Gaeke | 9722294 | 2003-09-05 19:39:22 +0000 | [diff] [blame] | 17 | #include "llvm/ExecutionEngine/ExecutionEngine.h" |
| 18 | #include "llvm/ExecutionEngine/GenericValue.h" |
Stephen Hines | 36b5688 | 2014-04-23 16:57:46 -0700 | [diff] [blame] | 19 | #include "llvm/IR/CallSite.h" |
Chandler Carruth | 0b8c9a8 | 2013-01-02 11:36:10 +0000 | [diff] [blame] | 20 | #include "llvm/IR/DataLayout.h" |
| 21 | #include "llvm/IR/Function.h" |
Stephen Hines | 36b5688 | 2014-04-23 16:57:46 -0700 | [diff] [blame] | 22 | #include "llvm/IR/InstVisitor.h" |
Michael J. Spencer | 1f6efa3 | 2010-11-29 18:16:10 +0000 | [diff] [blame] | 23 | #include "llvm/Support/DataTypes.h" |
Torok Edwin | c25e758 | 2009-07-11 20:10:48 +0000 | [diff] [blame] | 24 | #include "llvm/Support/ErrorHandling.h" |
Chris Lattner | bdff548 | 2009-08-23 04:37:46 +0000 | [diff] [blame] | 25 | #include "llvm/Support/raw_ostream.h" |
Brian Gaeke | d0fde30 | 2003-11-11 22:41:34 +0000 | [diff] [blame] | 26 | namespace llvm { |
| 27 | |
Chris Lattner | 726c1ef | 2006-03-23 05:22:51 +0000 | [diff] [blame] | 28 | class IntrinsicLowering; |
Chris Lattner | b1dfc70 | 2004-02-26 07:59:22 +0000 | [diff] [blame] | 29 | struct FunctionInfo; |
Chris Lattner | c6b0fb3 | 2004-04-04 17:30:06 +0000 | [diff] [blame] | 30 | template<typename T> class generic_gep_type_iterator; |
Brian Gaeke | dfa5849 | 2003-12-11 00:23:28 +0000 | [diff] [blame] | 31 | class ConstantExpr; |
Chris Lattner | 702a8a0 | 2004-04-04 19:47:06 +0000 | [diff] [blame] | 32 | typedef generic_gep_type_iterator<User::const_op_iterator> gep_type_iterator; |
Chris Lattner | c6b0fb3 | 2004-04-04 17:30:06 +0000 | [diff] [blame] | 33 | |
Chris Lattner | 92101ac | 2001-08-23 17:05:04 +0000 | [diff] [blame] | 34 | |
Chris Lattner | 9bffa73 | 2002-02-19 18:50:09 +0000 | [diff] [blame] | 35 | // AllocaHolder - Object to track all of the blocks of memory allocated by |
Brian Gaeke | dfa5849 | 2003-12-11 00:23:28 +0000 | [diff] [blame] | 36 | // alloca. When the function returns, this object is popped off the execution |
Chris Lattner | 9bffa73 | 2002-02-19 18:50:09 +0000 | [diff] [blame] | 37 | // stack, which causes the dtor to be run, which frees all the alloca'd memory. |
| 38 | // |
| 39 | class AllocaHolder { |
Stephen Hines | 37ed9c1 | 2014-12-01 14:51:49 -0800 | [diff] [blame^] | 40 | std::vector<void *> Allocations; |
| 41 | |
Chris Lattner | 9bffa73 | 2002-02-19 18:50:09 +0000 | [diff] [blame] | 42 | public: |
Stephen Hines | 37ed9c1 | 2014-12-01 14:51:49 -0800 | [diff] [blame^] | 43 | AllocaHolder() {} |
| 44 | |
| 45 | // Make this type move-only. Define explicit move special members for MSVC. |
| 46 | AllocaHolder(AllocaHolder &&RHS) : Allocations(std::move(RHS.Allocations)) {} |
| 47 | AllocaHolder &operator=(AllocaHolder &&RHS) { |
| 48 | Allocations = std::move(RHS.Allocations); |
| 49 | return *this; |
Chris Lattner | 9bffa73 | 2002-02-19 18:50:09 +0000 | [diff] [blame] | 50 | } |
Chris Lattner | 9bffa73 | 2002-02-19 18:50:09 +0000 | [diff] [blame] | 51 | |
Stephen Hines | 37ed9c1 | 2014-12-01 14:51:49 -0800 | [diff] [blame^] | 52 | ~AllocaHolder() { |
| 53 | for (void *Allocation : Allocations) |
| 54 | free(Allocation); |
| 55 | } |
Chris Lattner | 9bffa73 | 2002-02-19 18:50:09 +0000 | [diff] [blame] | 56 | |
Stephen Hines | 37ed9c1 | 2014-12-01 14:51:49 -0800 | [diff] [blame^] | 57 | void add(void *Mem) { Allocations.push_back(Mem); } |
Chris Lattner | 9bffa73 | 2002-02-19 18:50:09 +0000 | [diff] [blame] | 58 | }; |
| 59 | |
Chris Lattner | 697954c | 2002-01-20 22:54:45 +0000 | [diff] [blame] | 60 | typedef std::vector<GenericValue> ValuePlaneTy; |
Chris Lattner | 92101ac | 2001-08-23 17:05:04 +0000 | [diff] [blame] | 61 | |
| 62 | // ExecutionContext struct - This struct represents one stack frame currently |
| 63 | // executing. |
| 64 | // |
| 65 | struct ExecutionContext { |
Chris Lattner | da82ed5 | 2003-05-08 16:18:31 +0000 | [diff] [blame] | 66 | Function *CurFunction;// The currently executing function |
Chris Lattner | 92101ac | 2001-08-23 17:05:04 +0000 | [diff] [blame] | 67 | BasicBlock *CurBB; // The currently executing BB |
| 68 | BasicBlock::iterator CurInst; // The next instruction to execute |
Brian Gaeke | 2cb474c | 2003-11-07 19:26:23 +0000 | [diff] [blame] | 69 | CallSite Caller; // Holds the call that called subframes. |
| 70 | // NULL if main func or debugger invoked fn |
Stephen Hines | 37ed9c1 | 2014-12-01 14:51:49 -0800 | [diff] [blame^] | 71 | std::map<Value *, GenericValue> Values; // LLVM values used in this invocation |
| 72 | std::vector<GenericValue> VarArgs; // Values passed through an ellipsis |
| 73 | AllocaHolder Allocas; // Track memory allocated by alloca |
| 74 | |
| 75 | ExecutionContext() : CurFunction(nullptr), CurBB(nullptr), CurInst(nullptr) {} |
| 76 | |
| 77 | ExecutionContext(ExecutionContext &&O) |
| 78 | : CurFunction(O.CurFunction), CurBB(O.CurBB), CurInst(O.CurInst), |
| 79 | Caller(O.Caller), Values(std::move(O.Values)), |
| 80 | VarArgs(std::move(O.VarArgs)), Allocas(std::move(O.Allocas)) {} |
| 81 | |
| 82 | ExecutionContext &operator=(ExecutionContext &&O) { |
| 83 | CurFunction = O.CurFunction; |
| 84 | CurBB = O.CurBB; |
| 85 | CurInst = O.CurInst; |
| 86 | Caller = O.Caller; |
| 87 | Values = std::move(O.Values); |
| 88 | VarArgs = std::move(O.VarArgs); |
| 89 | Allocas = std::move(O.Allocas); |
| 90 | return *this; |
| 91 | } |
Chris Lattner | 92101ac | 2001-08-23 17:05:04 +0000 | [diff] [blame] | 92 | }; |
| 93 | |
Chris Lattner | 92101ac | 2001-08-23 17:05:04 +0000 | [diff] [blame] | 94 | // Interpreter - This class represents the entirety of the interpreter. |
| 95 | // |
Chris Lattner | d7916e9 | 2003-05-10 21:22:39 +0000 | [diff] [blame] | 96 | class Interpreter : public ExecutionEngine, public InstVisitor<Interpreter> { |
Jeff Cohen | 8c9191c | 2006-02-07 05:29:44 +0000 | [diff] [blame] | 97 | GenericValue ExitValue; // The return value of the called function |
Micah Villmow | 3574eca | 2012-10-08 16:38:25 +0000 | [diff] [blame] | 98 | DataLayout TD; |
Chris Lattner | 7301178 | 2003-12-28 09:44:37 +0000 | [diff] [blame] | 99 | IntrinsicLowering *IL; |
Chris Lattner | 92101ac | 2001-08-23 17:05:04 +0000 | [diff] [blame] | 100 | |
| 101 | // The runtime stack of executing code. The top of the stack is the current |
Chris Lattner | 2fbfdcf | 2002-04-07 20:49:59 +0000 | [diff] [blame] | 102 | // function record. |
Chris Lattner | 697954c | 2002-01-20 22:54:45 +0000 | [diff] [blame] | 103 | std::vector<ExecutionContext> ECStack; |
Chris Lattner | 92101ac | 2001-08-23 17:05:04 +0000 | [diff] [blame] | 104 | |
Brian Gaeke | 70975ee | 2003-09-05 18:42:01 +0000 | [diff] [blame] | 105 | // AtExitHandlers - List of functions to call when the program exits, |
| 106 | // registered with the atexit() library function. |
Chris Lattner | 44edb6b | 2003-05-14 14:21:30 +0000 | [diff] [blame] | 107 | std::vector<Function*> AtExitHandlers; |
Chris Lattner | 63bd613 | 2003-09-17 17:26:22 +0000 | [diff] [blame] | 108 | |
Chris Lattner | 92101ac | 2001-08-23 17:05:04 +0000 | [diff] [blame] | 109 | public: |
Stephen Hines | 37ed9c1 | 2014-12-01 14:51:49 -0800 | [diff] [blame^] | 110 | explicit Interpreter(std::unique_ptr<Module> M); |
Chris Lattner | 7301178 | 2003-12-28 09:44:37 +0000 | [diff] [blame] | 111 | ~Interpreter(); |
Chris Lattner | 92101ac | 2001-08-23 17:05:04 +0000 | [diff] [blame] | 112 | |
Chris Lattner | 2cab55d | 2003-12-26 06:13:05 +0000 | [diff] [blame] | 113 | /// runAtExitHandlers - Run any functions registered by the program's calls to |
| 114 | /// atexit(3), which we intercept and store in AtExitHandlers. |
Brian Gaeke | 70975ee | 2003-09-05 18:42:01 +0000 | [diff] [blame] | 115 | /// |
Chris Lattner | 2cab55d | 2003-12-26 06:13:05 +0000 | [diff] [blame] | 116 | void runAtExitHandlers(); |
Brian Gaeke | 70975ee | 2003-09-05 18:42:01 +0000 | [diff] [blame] | 117 | |
Chris Lattner | 2fe4bb0 | 2006-03-22 06:07:50 +0000 | [diff] [blame] | 118 | static void Register() { |
| 119 | InterpCtor = create; |
| 120 | } |
Stephen Hines | 37ed9c1 | 2014-12-01 14:51:49 -0800 | [diff] [blame^] | 121 | |
| 122 | /// Create an interpreter ExecutionEngine. |
Brian Gaeke | 82d8277 | 2003-09-03 20:34:19 +0000 | [diff] [blame] | 123 | /// |
Stephen Hines | 37ed9c1 | 2014-12-01 14:51:49 -0800 | [diff] [blame^] | 124 | static ExecutionEngine *create(std::unique_ptr<Module> M, |
| 125 | std::string *ErrorStr = nullptr); |
Brian Gaeke | 82d8277 | 2003-09-03 20:34:19 +0000 | [diff] [blame] | 126 | |
Chris Lattner | fe11a97 | 2002-12-23 23:59:41 +0000 | [diff] [blame] | 127 | /// run - Start execution with the specified function and arguments. |
| 128 | /// |
Stephen Hines | 36b5688 | 2014-04-23 16:57:46 -0700 | [diff] [blame] | 129 | GenericValue runFunction(Function *F, |
| 130 | const std::vector<GenericValue> &ArgValues) override; |
Chris Lattner | 92101ac | 2001-08-23 17:05:04 +0000 | [diff] [blame] | 131 | |
Stephen Hines | 37ed9c1 | 2014-12-01 14:51:49 -0800 | [diff] [blame^] | 132 | void *getPointerToNamedFunction(StringRef Name, |
Stephen Hines | 36b5688 | 2014-04-23 16:57:46 -0700 | [diff] [blame] | 133 | bool AbortOnFailure = true) override { |
Danil Malyshev | 45a93d6 | 2012-01-05 21:16:14 +0000 | [diff] [blame] | 134 | // FIXME: not implemented. |
Stephen Hines | dce4a40 | 2014-05-29 02:49:00 -0700 | [diff] [blame] | 135 | return nullptr; |
Bill Wendling | 4302a49 | 2012-01-23 22:55:02 +0000 | [diff] [blame] | 136 | } |
Danil Malyshev | 45a93d6 | 2012-01-05 21:16:14 +0000 | [diff] [blame] | 137 | |
Brian Gaeke | 70975ee | 2003-09-05 18:42:01 +0000 | [diff] [blame] | 138 | // Methods used to execute code: |
| 139 | // Place a call on the stack |
Chris Lattner | da82ed5 | 2003-05-08 16:18:31 +0000 | [diff] [blame] | 140 | void callFunction(Function *F, const std::vector<GenericValue> &ArgVals); |
Brian Gaeke | 70975ee | 2003-09-05 18:42:01 +0000 | [diff] [blame] | 141 | void run(); // Execute instructions until nothing left to do |
Chris Lattner | 92101ac | 2001-08-23 17:05:04 +0000 | [diff] [blame] | 142 | |
| 143 | // Opcode Implementations |
Chris Lattner | d7916e9 | 2003-05-10 21:22:39 +0000 | [diff] [blame] | 144 | void visitReturnInst(ReturnInst &I); |
| 145 | void visitBranchInst(BranchInst &I); |
| 146 | void visitSwitchInst(SwitchInst &I); |
Chris Lattner | f32a6a3 | 2009-10-29 05:26:09 +0000 | [diff] [blame] | 147 | void visitIndirectBrInst(IndirectBrInst &I); |
Chris Lattner | d7916e9 | 2003-05-10 21:22:39 +0000 | [diff] [blame] | 148 | |
| 149 | void visitBinaryOperator(BinaryOperator &I); |
Reid Spencer | e4d87aa | 2006-12-23 06:05:41 +0000 | [diff] [blame] | 150 | void visitICmpInst(ICmpInst &I); |
| 151 | void visitFCmpInst(FCmpInst &I); |
Victor Hernandez | 7b929da | 2009-10-23 21:09:37 +0000 | [diff] [blame] | 152 | void visitAllocaInst(AllocaInst &I); |
Chris Lattner | d7916e9 | 2003-05-10 21:22:39 +0000 | [diff] [blame] | 153 | void visitLoadInst(LoadInst &I); |
| 154 | void visitStoreInst(StoreInst &I); |
| 155 | void visitGetElementPtrInst(GetElementPtrInst &I); |
Torok Edwin | c25e758 | 2009-07-11 20:10:48 +0000 | [diff] [blame] | 156 | void visitPHINode(PHINode &PN) { |
Torok Edwin | c23197a | 2009-07-14 16:55:14 +0000 | [diff] [blame] | 157 | llvm_unreachable("PHI nodes already handled!"); |
Torok Edwin | c25e758 | 2009-07-11 20:10:48 +0000 | [diff] [blame] | 158 | } |
Reid Spencer | a54b7cb | 2007-01-12 07:05:14 +0000 | [diff] [blame] | 159 | void visitTruncInst(TruncInst &I); |
| 160 | void visitZExtInst(ZExtInst &I); |
| 161 | void visitSExtInst(SExtInst &I); |
| 162 | void visitFPTruncInst(FPTruncInst &I); |
| 163 | void visitFPExtInst(FPExtInst &I); |
| 164 | void visitUIToFPInst(UIToFPInst &I); |
| 165 | void visitSIToFPInst(SIToFPInst &I); |
| 166 | void visitFPToUIInst(FPToUIInst &I); |
| 167 | void visitFPToSIInst(FPToSIInst &I); |
| 168 | void visitPtrToIntInst(PtrToIntInst &I); |
| 169 | void visitIntToPtrInst(IntToPtrInst &I); |
| 170 | void visitBitCastInst(BitCastInst &I); |
Chris Lattner | 759d34f | 2004-04-20 16:43:21 +0000 | [diff] [blame] | 171 | void visitSelectInst(SelectInst &I); |
| 172 | |
Brian Gaeke | fea483d | 2003-11-07 20:04:22 +0000 | [diff] [blame] | 173 | |
| 174 | void visitCallSite(CallSite CS); |
| 175 | void visitCallInst(CallInst &I) { visitCallSite (CallSite (&I)); } |
| 176 | void visitInvokeInst(InvokeInst &I) { visitCallSite (CallSite (&I)); } |
Chris Lattner | ec7c1ab | 2004-10-16 18:21:33 +0000 | [diff] [blame] | 177 | void visitUnreachableInst(UnreachableInst &I); |
Brian Gaeke | fea483d | 2003-11-07 20:04:22 +0000 | [diff] [blame] | 178 | |
Reid Spencer | 832254e | 2007-02-02 02:16:23 +0000 | [diff] [blame] | 179 | void visitShl(BinaryOperator &I); |
| 180 | void visitLShr(BinaryOperator &I); |
| 181 | void visitAShr(BinaryOperator &I); |
| 182 | |
Brian Gaeke | c1a2be1 | 2003-11-07 21:20:47 +0000 | [diff] [blame] | 183 | void visitVAArgInst(VAArgInst &I); |
Nadav Rotem | 953783e | 2013-04-01 15:53:30 +0000 | [diff] [blame] | 184 | void visitExtractElementInst(ExtractElementInst &I); |
Elena Demikhovsky | 4ca0ce2 | 2013-09-02 06:40:09 +0000 | [diff] [blame] | 185 | void visitInsertElementInst(InsertElementInst &I); |
| 186 | void visitShuffleVectorInst(ShuffleVectorInst &I); |
| 187 | |
Elena Demikhovsky | 3c5ce29 | 2013-09-12 10:48:23 +0000 | [diff] [blame] | 188 | void visitExtractValueInst(ExtractValueInst &I); |
| 189 | void visitInsertValueInst(InsertValueInst &I); |
| 190 | |
Chris Lattner | d7916e9 | 2003-05-10 21:22:39 +0000 | [diff] [blame] | 191 | void visitInstruction(Instruction &I) { |
Duncan Sands | a50c6d9 | 2011-09-09 20:22:48 +0000 | [diff] [blame] | 192 | errs() << I << "\n"; |
Torok Edwin | c23197a | 2009-07-14 16:55:14 +0000 | [diff] [blame] | 193 | llvm_unreachable("Instruction not interpretable yet!"); |
Chris Lattner | d7916e9 | 2003-05-10 21:22:39 +0000 | [diff] [blame] | 194 | } |
| 195 | |
Misha Brukman | d1c881a | 2005-04-21 22:43:08 +0000 | [diff] [blame] | 196 | GenericValue callExternalFunction(Function *F, |
Chris Lattner | da82ed5 | 2003-05-08 16:18:31 +0000 | [diff] [blame] | 197 | const std::vector<GenericValue> &ArgVals); |
Chris Lattner | e43db88 | 2001-10-27 04:15:57 +0000 | [diff] [blame] | 198 | void exitCalled(GenericValue GV); |
Chris Lattner | 92101ac | 2001-08-23 17:05:04 +0000 | [diff] [blame] | 199 | |
Chris Lattner | 44edb6b | 2003-05-14 14:21:30 +0000 | [diff] [blame] | 200 | void addAtExitHandler(Function *F) { |
| 201 | AtExitHandlers.push_back(F); |
| 202 | } |
| 203 | |
Brian Gaeke | 8da1748 | 2003-11-13 06:06:01 +0000 | [diff] [blame] | 204 | GenericValue *getFirstVarArg () { |
Brian Gaeke | e625890 | 2004-02-13 06:18:39 +0000 | [diff] [blame] | 205 | return &(ECStack.back ().VarArgs[0]); |
Brian Gaeke | 8da1748 | 2003-11-13 06:06:01 +0000 | [diff] [blame] | 206 | } |
| 207 | |
Dan Gohman | 4781e30 | 2010-05-01 02:43:10 +0000 | [diff] [blame] | 208 | private: // Helper functions |
Chris Lattner | 4af6de8 | 2003-11-25 20:44:56 +0000 | [diff] [blame] | 209 | GenericValue executeGEPOperation(Value *Ptr, gep_type_iterator I, |
Misha Brukman | 3c94497 | 2005-04-22 04:08:30 +0000 | [diff] [blame] | 210 | gep_type_iterator E, ExecutionContext &SF); |
Chris Lattner | fe11a97 | 2002-12-23 23:59:41 +0000 | [diff] [blame] | 211 | |
Chris Lattner | 77113b6 | 2003-05-10 20:21:16 +0000 | [diff] [blame] | 212 | // SwitchToNewBasicBlock - Start execution in a new basic block and run any |
| 213 | // PHI nodes in the top of the block. This is used for intraprocedural |
| 214 | // control flow. |
Misha Brukman | d1c881a | 2005-04-21 22:43:08 +0000 | [diff] [blame] | 215 | // |
Chris Lattner | 77113b6 | 2003-05-10 20:21:16 +0000 | [diff] [blame] | 216 | void SwitchToNewBasicBlock(BasicBlock *Dest, ExecutionContext &SF); |
| 217 | |
Stephen Hines | 36b5688 | 2014-04-23 16:57:46 -0700 | [diff] [blame] | 218 | void *getPointerToFunction(Function *F) override { return (void*)F; } |
Chris Lattner | fe11a97 | 2002-12-23 23:59:41 +0000 | [diff] [blame] | 219 | |
Owen Anderson | fdca74c | 2009-06-26 16:46:15 +0000 | [diff] [blame] | 220 | void initializeExecutionEngine() { } |
Chris Lattner | da82ed5 | 2003-05-08 16:18:31 +0000 | [diff] [blame] | 221 | void initializeExternalFunctions(); |
Brian Gaeke | dfa5849 | 2003-12-11 00:23:28 +0000 | [diff] [blame] | 222 | GenericValue getConstantExprValue(ConstantExpr *CE, ExecutionContext &SF); |
Brian Gaeke | 29794cb | 2003-09-05 18:55:03 +0000 | [diff] [blame] | 223 | GenericValue getOperandValue(Value *V, ExecutionContext &SF); |
Chris Lattner | db125cf | 2011-07-18 04:54:35 +0000 | [diff] [blame] | 224 | GenericValue executeTruncInst(Value *SrcVal, Type *DstTy, |
Reid Spencer | a54b7cb | 2007-01-12 07:05:14 +0000 | [diff] [blame] | 225 | ExecutionContext &SF); |
Chris Lattner | db125cf | 2011-07-18 04:54:35 +0000 | [diff] [blame] | 226 | GenericValue executeSExtInst(Value *SrcVal, Type *DstTy, |
Reid Spencer | a54b7cb | 2007-01-12 07:05:14 +0000 | [diff] [blame] | 227 | ExecutionContext &SF); |
Chris Lattner | db125cf | 2011-07-18 04:54:35 +0000 | [diff] [blame] | 228 | GenericValue executeZExtInst(Value *SrcVal, Type *DstTy, |
Reid Spencer | a54b7cb | 2007-01-12 07:05:14 +0000 | [diff] [blame] | 229 | ExecutionContext &SF); |
Chris Lattner | db125cf | 2011-07-18 04:54:35 +0000 | [diff] [blame] | 230 | GenericValue executeFPTruncInst(Value *SrcVal, Type *DstTy, |
Reid Spencer | a54b7cb | 2007-01-12 07:05:14 +0000 | [diff] [blame] | 231 | ExecutionContext &SF); |
Chris Lattner | db125cf | 2011-07-18 04:54:35 +0000 | [diff] [blame] | 232 | GenericValue executeFPExtInst(Value *SrcVal, Type *DstTy, |
Reid Spencer | a54b7cb | 2007-01-12 07:05:14 +0000 | [diff] [blame] | 233 | ExecutionContext &SF); |
Chris Lattner | db125cf | 2011-07-18 04:54:35 +0000 | [diff] [blame] | 234 | GenericValue executeFPToUIInst(Value *SrcVal, Type *DstTy, |
Reid Spencer | a54b7cb | 2007-01-12 07:05:14 +0000 | [diff] [blame] | 235 | ExecutionContext &SF); |
Chris Lattner | db125cf | 2011-07-18 04:54:35 +0000 | [diff] [blame] | 236 | GenericValue executeFPToSIInst(Value *SrcVal, Type *DstTy, |
Reid Spencer | a54b7cb | 2007-01-12 07:05:14 +0000 | [diff] [blame] | 237 | ExecutionContext &SF); |
Chris Lattner | db125cf | 2011-07-18 04:54:35 +0000 | [diff] [blame] | 238 | GenericValue executeUIToFPInst(Value *SrcVal, Type *DstTy, |
Reid Spencer | a54b7cb | 2007-01-12 07:05:14 +0000 | [diff] [blame] | 239 | ExecutionContext &SF); |
Chris Lattner | db125cf | 2011-07-18 04:54:35 +0000 | [diff] [blame] | 240 | GenericValue executeSIToFPInst(Value *SrcVal, Type *DstTy, |
Reid Spencer | a54b7cb | 2007-01-12 07:05:14 +0000 | [diff] [blame] | 241 | ExecutionContext &SF); |
Chris Lattner | db125cf | 2011-07-18 04:54:35 +0000 | [diff] [blame] | 242 | GenericValue executePtrToIntInst(Value *SrcVal, Type *DstTy, |
Reid Spencer | a54b7cb | 2007-01-12 07:05:14 +0000 | [diff] [blame] | 243 | ExecutionContext &SF); |
Chris Lattner | db125cf | 2011-07-18 04:54:35 +0000 | [diff] [blame] | 244 | GenericValue executeIntToPtrInst(Value *SrcVal, Type *DstTy, |
Reid Spencer | a54b7cb | 2007-01-12 07:05:14 +0000 | [diff] [blame] | 245 | ExecutionContext &SF); |
Chris Lattner | db125cf | 2011-07-18 04:54:35 +0000 | [diff] [blame] | 246 | GenericValue executeBitCastInst(Value *SrcVal, Type *DstTy, |
Reid Spencer | a54b7cb | 2007-01-12 07:05:14 +0000 | [diff] [blame] | 247 | ExecutionContext &SF); |
Reid Spencer | 3da59db | 2006-11-27 01:05:10 +0000 | [diff] [blame] | 248 | GenericValue executeCastOperation(Instruction::CastOps opcode, Value *SrcVal, |
Chris Lattner | db125cf | 2011-07-18 04:54:35 +0000 | [diff] [blame] | 249 | Type *Ty, ExecutionContext &SF); |
| 250 | void popStackAndReturnValueToCaller(Type *RetTy, GenericValue Result); |
Reid Spencer | 90935f6 | 2007-01-18 02:12:10 +0000 | [diff] [blame] | 251 | |
Chris Lattner | 92101ac | 2001-08-23 17:05:04 +0000 | [diff] [blame] | 252 | }; |
| 253 | |
Brian Gaeke | d0fde30 | 2003-11-11 22:41:34 +0000 | [diff] [blame] | 254 | } // End llvm namespace |
| 255 | |
Chris Lattner | 92101ac | 2001-08-23 17:05:04 +0000 | [diff] [blame] | 256 | #endif |