Chris Lattner | d7ff578 | 2001-08-23 17:05:04 +0000 | [diff] [blame] | 1 | //===-- Interpreter.h ------------------------------------------*- C++ -*--===// |
Misha Brukman | 91fb9ab | 2005-04-21 22:43:08 +0000 | [diff] [blame] | 2 | // |
John Criswell | 29265fe | 2003-10-21 15:17:13 +0000 | [diff] [blame] | 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | f3ebc3f | 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 | 91fb9ab | 2005-04-21 22:43:08 +0000 | [diff] [blame] | 7 | // |
John Criswell | 29265fe | 2003-10-21 15:17:13 +0000 | [diff] [blame] | 8 | //===----------------------------------------------------------------------===// |
Chris Lattner | d7ff578 | 2001-08-23 17:05:04 +0000 | [diff] [blame] | 9 | // |
| 10 | // This header file defines the interpreter structure |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
Benjamin Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 14 | #ifndef LLVM_LIB_EXECUTIONENGINE_INTERPRETER_INTERPRETER_H |
| 15 | #define LLVM_LIB_EXECUTIONENGINE_INTERPRETER_INTERPRETER_H |
Chris Lattner | d7ff578 | 2001-08-23 17:05:04 +0000 | [diff] [blame] | 16 | |
Brian Gaeke | f3a300d | 2003-09-05 19:39:22 +0000 | [diff] [blame] | 17 | #include "llvm/ExecutionEngine/ExecutionEngine.h" |
| 18 | #include "llvm/ExecutionEngine/GenericValue.h" |
Chandler Carruth | 219b89b | 2014-03-04 11:01:28 +0000 | [diff] [blame] | 19 | #include "llvm/IR/CallSite.h" |
Chandler Carruth | 9fb823b | 2013-01-02 11:36:10 +0000 | [diff] [blame] | 20 | #include "llvm/IR/DataLayout.h" |
| 21 | #include "llvm/IR/Function.h" |
Chandler Carruth | 7da14f1 | 2014-03-06 03:23:41 +0000 | [diff] [blame] | 22 | #include "llvm/IR/InstVisitor.h" |
Michael J. Spencer | 447762d | 2010-11-29 18:16:10 +0000 | [diff] [blame] | 23 | #include "llvm/Support/DataTypes.h" |
Torok Edwin | 56d0659 | 2009-07-11 20:10:48 +0000 | [diff] [blame] | 24 | #include "llvm/Support/ErrorHandling.h" |
Chris Lattner | b25de3f | 2009-08-23 04:37:46 +0000 | [diff] [blame] | 25 | #include "llvm/Support/raw_ostream.h" |
Brian Gaeke | 960707c | 2003-11-11 22:41:34 +0000 | [diff] [blame] | 26 | namespace llvm { |
| 27 | |
Chris Lattner | 0b2de9f | 2006-03-23 05:22:51 +0000 | [diff] [blame] | 28 | class IntrinsicLowering; |
Chris Lattner | 234a2d4 | 2004-02-26 07:59:22 +0000 | [diff] [blame] | 29 | struct FunctionInfo; |
Chris Lattner | 092d260 | 2004-04-04 17:30:06 +0000 | [diff] [blame] | 30 | template<typename T> class generic_gep_type_iterator; |
Brian Gaeke | 2bba152 | 2003-12-11 00:23:28 +0000 | [diff] [blame] | 31 | class ConstantExpr; |
Chris Lattner | ca76d11 | 2004-04-04 19:47:06 +0000 | [diff] [blame] | 32 | typedef generic_gep_type_iterator<User::const_op_iterator> gep_type_iterator; |
Chris Lattner | 092d260 | 2004-04-04 17:30:06 +0000 | [diff] [blame] | 33 | |
Chris Lattner | d7ff578 | 2001-08-23 17:05:04 +0000 | [diff] [blame] | 34 | |
Chris Lattner | fb55ba0 | 2002-02-19 18:50:09 +0000 | [diff] [blame] | 35 | // AllocaHolder - Object to track all of the blocks of memory allocated by |
Brian Gaeke | 2bba152 | 2003-12-11 00:23:28 +0000 | [diff] [blame] | 36 | // alloca. When the function returns, this object is popped off the execution |
Chris Lattner | fb55ba0 | 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 { |
Benjamin Kramer | fe5a5f6 | 2014-09-15 19:20:52 +0000 | [diff] [blame] | 40 | std::vector<void *> Allocations; |
| 41 | |
Chris Lattner | fb55ba0 | 2002-02-19 18:50:09 +0000 | [diff] [blame] | 42 | public: |
Benjamin Kramer | fe5a5f6 | 2014-09-15 19:20:52 +0000 | [diff] [blame] | 43 | AllocaHolder() {} |
| 44 | // Make this type move-only. |
| 45 | AllocaHolder(AllocaHolder &&RHS) : Allocations(std::move(RHS.Allocations)) {} |
| 46 | AllocaHolder &operator=(AllocaHolder &&RHS) { |
| 47 | Allocations = std::move(RHS.Allocations); |
Benjamin Kramer | 88860cb | 2014-09-15 19:25:55 +0000 | [diff] [blame^] | 48 | return *this; |
Chris Lattner | fb55ba0 | 2002-02-19 18:50:09 +0000 | [diff] [blame] | 49 | } |
Chris Lattner | fb55ba0 | 2002-02-19 18:50:09 +0000 | [diff] [blame] | 50 | |
Benjamin Kramer | fe5a5f6 | 2014-09-15 19:20:52 +0000 | [diff] [blame] | 51 | ~AllocaHolder() { |
| 52 | for (void *Allocation : Allocations) |
| 53 | free(Allocation); |
| 54 | } |
Chris Lattner | fb55ba0 | 2002-02-19 18:50:09 +0000 | [diff] [blame] | 55 | |
Benjamin Kramer | fe5a5f6 | 2014-09-15 19:20:52 +0000 | [diff] [blame] | 56 | void add(void *Mem) { Allocations.push_back(Mem); } |
Chris Lattner | fb55ba0 | 2002-02-19 18:50:09 +0000 | [diff] [blame] | 57 | }; |
| 58 | |
Chris Lattner | 7f74a56 | 2002-01-20 22:54:45 +0000 | [diff] [blame] | 59 | typedef std::vector<GenericValue> ValuePlaneTy; |
Chris Lattner | d7ff578 | 2001-08-23 17:05:04 +0000 | [diff] [blame] | 60 | |
| 61 | // ExecutionContext struct - This struct represents one stack frame currently |
| 62 | // executing. |
| 63 | // |
| 64 | struct ExecutionContext { |
Chris Lattner | 470754e | 2003-05-08 16:18:31 +0000 | [diff] [blame] | 65 | Function *CurFunction;// The currently executing function |
Chris Lattner | d7ff578 | 2001-08-23 17:05:04 +0000 | [diff] [blame] | 66 | BasicBlock *CurBB; // The currently executing BB |
| 67 | BasicBlock::iterator CurInst; // The next instruction to execute |
Brian Gaeke | b77e589 | 2003-10-24 19:59:37 +0000 | [diff] [blame] | 68 | std::map<Value *, GenericValue> Values; // LLVM values used in this invocation |
Chris Lattner | 22e9043 | 2003-05-08 16:06:52 +0000 | [diff] [blame] | 69 | std::vector<GenericValue> VarArgs; // Values passed through an ellipsis |
Brian Gaeke | 18b5957 | 2003-11-07 19:26:23 +0000 | [diff] [blame] | 70 | CallSite Caller; // Holds the call that called subframes. |
| 71 | // NULL if main func or debugger invoked fn |
Benjamin Kramer | fe5a5f6 | 2014-09-15 19:20:52 +0000 | [diff] [blame] | 72 | AllocaHolder Allocas; // Track memory allocated by alloca |
Chris Lattner | d7ff578 | 2001-08-23 17:05:04 +0000 | [diff] [blame] | 73 | }; |
| 74 | |
Chris Lattner | d7ff578 | 2001-08-23 17:05:04 +0000 | [diff] [blame] | 75 | // Interpreter - This class represents the entirety of the interpreter. |
| 76 | // |
Chris Lattner | 185045c | 2003-05-10 21:22:39 +0000 | [diff] [blame] | 77 | class Interpreter : public ExecutionEngine, public InstVisitor<Interpreter> { |
Jeff Cohen | 2439669 | 2006-02-07 05:29:44 +0000 | [diff] [blame] | 78 | GenericValue ExitValue; // The return value of the called function |
Micah Villmow | cdfe20b | 2012-10-08 16:38:25 +0000 | [diff] [blame] | 79 | DataLayout TD; |
Chris Lattner | c8c6c03 | 2003-12-28 09:44:37 +0000 | [diff] [blame] | 80 | IntrinsicLowering *IL; |
Chris Lattner | d7ff578 | 2001-08-23 17:05:04 +0000 | [diff] [blame] | 81 | |
| 82 | // The runtime stack of executing code. The top of the stack is the current |
Chris Lattner | 62b7fd1 | 2002-04-07 20:49:59 +0000 | [diff] [blame] | 83 | // function record. |
Chris Lattner | 7f74a56 | 2002-01-20 22:54:45 +0000 | [diff] [blame] | 84 | std::vector<ExecutionContext> ECStack; |
Chris Lattner | d7ff578 | 2001-08-23 17:05:04 +0000 | [diff] [blame] | 85 | |
Brian Gaeke | a766903 | 2003-09-05 18:42:01 +0000 | [diff] [blame] | 86 | // AtExitHandlers - List of functions to call when the program exits, |
| 87 | // registered with the atexit() library function. |
Chris Lattner | 4a5bb95 | 2003-05-14 14:21:30 +0000 | [diff] [blame] | 88 | std::vector<Function*> AtExitHandlers; |
Chris Lattner | a28e1f2 | 2003-09-17 17:26:22 +0000 | [diff] [blame] | 89 | |
Chris Lattner | d7ff578 | 2001-08-23 17:05:04 +0000 | [diff] [blame] | 90 | public: |
Rafael Espindola | 2a8a279 | 2014-08-19 04:04:25 +0000 | [diff] [blame] | 91 | explicit Interpreter(std::unique_ptr<Module> M); |
Chris Lattner | c8c6c03 | 2003-12-28 09:44:37 +0000 | [diff] [blame] | 92 | ~Interpreter(); |
Chris Lattner | d7ff578 | 2001-08-23 17:05:04 +0000 | [diff] [blame] | 93 | |
Chris Lattner | d94296c | 2003-12-26 06:13:05 +0000 | [diff] [blame] | 94 | /// runAtExitHandlers - Run any functions registered by the program's calls to |
| 95 | /// atexit(3), which we intercept and store in AtExitHandlers. |
Brian Gaeke | a766903 | 2003-09-05 18:42:01 +0000 | [diff] [blame] | 96 | /// |
Chris Lattner | d94296c | 2003-12-26 06:13:05 +0000 | [diff] [blame] | 97 | void runAtExitHandlers(); |
Brian Gaeke | a766903 | 2003-09-05 18:42:01 +0000 | [diff] [blame] | 98 | |
Chris Lattner | 2d52c1b | 2006-03-22 06:07:50 +0000 | [diff] [blame] | 99 | static void Register() { |
| 100 | InterpCtor = create; |
| 101 | } |
Rafael Espindola | 2a8a279 | 2014-08-19 04:04:25 +0000 | [diff] [blame] | 102 | |
| 103 | /// Create an interpreter ExecutionEngine. |
Brian Gaeke | 4bd3bd5 | 2003-09-03 20:34:19 +0000 | [diff] [blame] | 104 | /// |
Rafael Espindola | 2a8a279 | 2014-08-19 04:04:25 +0000 | [diff] [blame] | 105 | static ExecutionEngine *create(std::unique_ptr<Module> M, |
| 106 | std::string *ErrorStr = nullptr); |
Brian Gaeke | 4bd3bd5 | 2003-09-03 20:34:19 +0000 | [diff] [blame] | 107 | |
Chris Lattner | a0d7b08 | 2002-12-23 23:59:41 +0000 | [diff] [blame] | 108 | /// run - Start execution with the specified function and arguments. |
| 109 | /// |
Craig Topper | b51ff60 | 2014-03-08 07:51:20 +0000 | [diff] [blame] | 110 | GenericValue runFunction(Function *F, |
| 111 | const std::vector<GenericValue> &ArgValues) override; |
Chris Lattner | d7ff578 | 2001-08-23 17:05:04 +0000 | [diff] [blame] | 112 | |
Lang Hames | 9a78334 | 2014-09-15 17:50:22 +0000 | [diff] [blame] | 113 | void *getPointerToNamedFunction(StringRef Name, |
Craig Topper | b51ff60 | 2014-03-08 07:51:20 +0000 | [diff] [blame] | 114 | bool AbortOnFailure = true) override { |
Danil Malyshev | 7e32578 | 2012-01-05 21:16:14 +0000 | [diff] [blame] | 115 | // FIXME: not implemented. |
Craig Topper | e73658d | 2014-04-28 04:05:08 +0000 | [diff] [blame] | 116 | return nullptr; |
Bill Wendling | 11eeeff | 2012-01-23 22:55:02 +0000 | [diff] [blame] | 117 | } |
Danil Malyshev | 7e32578 | 2012-01-05 21:16:14 +0000 | [diff] [blame] | 118 | |
Brian Gaeke | a766903 | 2003-09-05 18:42:01 +0000 | [diff] [blame] | 119 | // Methods used to execute code: |
| 120 | // Place a call on the stack |
Chris Lattner | 470754e | 2003-05-08 16:18:31 +0000 | [diff] [blame] | 121 | void callFunction(Function *F, const std::vector<GenericValue> &ArgVals); |
Brian Gaeke | a766903 | 2003-09-05 18:42:01 +0000 | [diff] [blame] | 122 | void run(); // Execute instructions until nothing left to do |
Chris Lattner | d7ff578 | 2001-08-23 17:05:04 +0000 | [diff] [blame] | 123 | |
| 124 | // Opcode Implementations |
Chris Lattner | 185045c | 2003-05-10 21:22:39 +0000 | [diff] [blame] | 125 | void visitReturnInst(ReturnInst &I); |
| 126 | void visitBranchInst(BranchInst &I); |
| 127 | void visitSwitchInst(SwitchInst &I); |
Chris Lattner | 0c778f7 | 2009-10-29 05:26:09 +0000 | [diff] [blame] | 128 | void visitIndirectBrInst(IndirectBrInst &I); |
Chris Lattner | 185045c | 2003-05-10 21:22:39 +0000 | [diff] [blame] | 129 | |
| 130 | void visitBinaryOperator(BinaryOperator &I); |
Reid Spencer | 266e42b | 2006-12-23 06:05:41 +0000 | [diff] [blame] | 131 | void visitICmpInst(ICmpInst &I); |
| 132 | void visitFCmpInst(FCmpInst &I); |
Victor Hernandez | 8acf295 | 2009-10-23 21:09:37 +0000 | [diff] [blame] | 133 | void visitAllocaInst(AllocaInst &I); |
Chris Lattner | 185045c | 2003-05-10 21:22:39 +0000 | [diff] [blame] | 134 | void visitLoadInst(LoadInst &I); |
| 135 | void visitStoreInst(StoreInst &I); |
| 136 | void visitGetElementPtrInst(GetElementPtrInst &I); |
Torok Edwin | 56d0659 | 2009-07-11 20:10:48 +0000 | [diff] [blame] | 137 | void visitPHINode(PHINode &PN) { |
Torok Edwin | fbcc663 | 2009-07-14 16:55:14 +0000 | [diff] [blame] | 138 | llvm_unreachable("PHI nodes already handled!"); |
Torok Edwin | 56d0659 | 2009-07-11 20:10:48 +0000 | [diff] [blame] | 139 | } |
Reid Spencer | 7a9c62b | 2007-01-12 07:05:14 +0000 | [diff] [blame] | 140 | void visitTruncInst(TruncInst &I); |
| 141 | void visitZExtInst(ZExtInst &I); |
| 142 | void visitSExtInst(SExtInst &I); |
| 143 | void visitFPTruncInst(FPTruncInst &I); |
| 144 | void visitFPExtInst(FPExtInst &I); |
| 145 | void visitUIToFPInst(UIToFPInst &I); |
| 146 | void visitSIToFPInst(SIToFPInst &I); |
| 147 | void visitFPToUIInst(FPToUIInst &I); |
| 148 | void visitFPToSIInst(FPToSIInst &I); |
| 149 | void visitPtrToIntInst(PtrToIntInst &I); |
| 150 | void visitIntToPtrInst(IntToPtrInst &I); |
| 151 | void visitBitCastInst(BitCastInst &I); |
Chris Lattner | 2b2d7a9 | 2004-04-20 16:43:21 +0000 | [diff] [blame] | 152 | void visitSelectInst(SelectInst &I); |
| 153 | |
Brian Gaeke | a6454d35 | 2003-11-07 20:04:22 +0000 | [diff] [blame] | 154 | |
| 155 | void visitCallSite(CallSite CS); |
| 156 | void visitCallInst(CallInst &I) { visitCallSite (CallSite (&I)); } |
| 157 | void visitInvokeInst(InvokeInst &I) { visitCallSite (CallSite (&I)); } |
Chris Lattner | 98e5414 | 2004-10-16 18:21:33 +0000 | [diff] [blame] | 158 | void visitUnreachableInst(UnreachableInst &I); |
Brian Gaeke | a6454d35 | 2003-11-07 20:04:22 +0000 | [diff] [blame] | 159 | |
Reid Spencer | 2341c22 | 2007-02-02 02:16:23 +0000 | [diff] [blame] | 160 | void visitShl(BinaryOperator &I); |
| 161 | void visitLShr(BinaryOperator &I); |
| 162 | void visitAShr(BinaryOperator &I); |
| 163 | |
Brian Gaeke | 9ef636c | 2003-11-07 21:20:47 +0000 | [diff] [blame] | 164 | void visitVAArgInst(VAArgInst &I); |
Nadav Rotem | be79a7a | 2013-04-01 15:53:30 +0000 | [diff] [blame] | 165 | void visitExtractElementInst(ExtractElementInst &I); |
Elena Demikhovsky | 843657c | 2013-09-02 06:40:09 +0000 | [diff] [blame] | 166 | void visitInsertElementInst(InsertElementInst &I); |
| 167 | void visitShuffleVectorInst(ShuffleVectorInst &I); |
| 168 | |
Elena Demikhovsky | 8e97f01 | 2013-09-12 10:48:23 +0000 | [diff] [blame] | 169 | void visitExtractValueInst(ExtractValueInst &I); |
| 170 | void visitInsertValueInst(InsertValueInst &I); |
| 171 | |
Chris Lattner | 185045c | 2003-05-10 21:22:39 +0000 | [diff] [blame] | 172 | void visitInstruction(Instruction &I) { |
Duncan Sands | eee3fca | 2011-09-09 20:22:48 +0000 | [diff] [blame] | 173 | errs() << I << "\n"; |
Torok Edwin | fbcc663 | 2009-07-14 16:55:14 +0000 | [diff] [blame] | 174 | llvm_unreachable("Instruction not interpretable yet!"); |
Chris Lattner | 185045c | 2003-05-10 21:22:39 +0000 | [diff] [blame] | 175 | } |
| 176 | |
Misha Brukman | 91fb9ab | 2005-04-21 22:43:08 +0000 | [diff] [blame] | 177 | GenericValue callExternalFunction(Function *F, |
Chris Lattner | 470754e | 2003-05-08 16:18:31 +0000 | [diff] [blame] | 178 | const std::vector<GenericValue> &ArgVals); |
Chris Lattner | 15157b8 | 2001-10-27 04:15:57 +0000 | [diff] [blame] | 179 | void exitCalled(GenericValue GV); |
Chris Lattner | d7ff578 | 2001-08-23 17:05:04 +0000 | [diff] [blame] | 180 | |
Chris Lattner | 4a5bb95 | 2003-05-14 14:21:30 +0000 | [diff] [blame] | 181 | void addAtExitHandler(Function *F) { |
| 182 | AtExitHandlers.push_back(F); |
| 183 | } |
| 184 | |
Brian Gaeke | d81ca47 | 2003-11-13 06:06:01 +0000 | [diff] [blame] | 185 | GenericValue *getFirstVarArg () { |
Brian Gaeke | 242ebf2 | 2004-02-13 06:18:39 +0000 | [diff] [blame] | 186 | return &(ECStack.back ().VarArgs[0]); |
Brian Gaeke | d81ca47 | 2003-11-13 06:06:01 +0000 | [diff] [blame] | 187 | } |
| 188 | |
Dan Gohman | effa3e5 | 2010-05-01 02:43:10 +0000 | [diff] [blame] | 189 | private: // Helper functions |
Chris Lattner | f078808 | 2003-11-25 20:44:56 +0000 | [diff] [blame] | 190 | GenericValue executeGEPOperation(Value *Ptr, gep_type_iterator I, |
Misha Brukman | 5191b4b | 2005-04-22 04:08:30 +0000 | [diff] [blame] | 191 | gep_type_iterator E, ExecutionContext &SF); |
Chris Lattner | a0d7b08 | 2002-12-23 23:59:41 +0000 | [diff] [blame] | 192 | |
Chris Lattner | bd6771c | 2003-05-10 20:21:16 +0000 | [diff] [blame] | 193 | // SwitchToNewBasicBlock - Start execution in a new basic block and run any |
| 194 | // PHI nodes in the top of the block. This is used for intraprocedural |
| 195 | // control flow. |
Misha Brukman | 91fb9ab | 2005-04-21 22:43:08 +0000 | [diff] [blame] | 196 | // |
Chris Lattner | bd6771c | 2003-05-10 20:21:16 +0000 | [diff] [blame] | 197 | void SwitchToNewBasicBlock(BasicBlock *Dest, ExecutionContext &SF); |
| 198 | |
Craig Topper | b51ff60 | 2014-03-08 07:51:20 +0000 | [diff] [blame] | 199 | void *getPointerToFunction(Function *F) override { return (void*)F; } |
Chris Lattner | a0d7b08 | 2002-12-23 23:59:41 +0000 | [diff] [blame] | 200 | |
Owen Anderson | 455df54 | 2009-06-26 16:46:15 +0000 | [diff] [blame] | 201 | void initializeExecutionEngine() { } |
Chris Lattner | 470754e | 2003-05-08 16:18:31 +0000 | [diff] [blame] | 202 | void initializeExternalFunctions(); |
Brian Gaeke | 2bba152 | 2003-12-11 00:23:28 +0000 | [diff] [blame] | 203 | GenericValue getConstantExprValue(ConstantExpr *CE, ExecutionContext &SF); |
Brian Gaeke | 9b518bc | 2003-09-05 18:55:03 +0000 | [diff] [blame] | 204 | GenericValue getOperandValue(Value *V, ExecutionContext &SF); |
Chris Lattner | 229907c | 2011-07-18 04:54:35 +0000 | [diff] [blame] | 205 | GenericValue executeTruncInst(Value *SrcVal, Type *DstTy, |
Reid Spencer | 7a9c62b | 2007-01-12 07:05:14 +0000 | [diff] [blame] | 206 | ExecutionContext &SF); |
Chris Lattner | 229907c | 2011-07-18 04:54:35 +0000 | [diff] [blame] | 207 | GenericValue executeSExtInst(Value *SrcVal, Type *DstTy, |
Reid Spencer | 7a9c62b | 2007-01-12 07:05:14 +0000 | [diff] [blame] | 208 | ExecutionContext &SF); |
Chris Lattner | 229907c | 2011-07-18 04:54:35 +0000 | [diff] [blame] | 209 | GenericValue executeZExtInst(Value *SrcVal, Type *DstTy, |
Reid Spencer | 7a9c62b | 2007-01-12 07:05:14 +0000 | [diff] [blame] | 210 | ExecutionContext &SF); |
Chris Lattner | 229907c | 2011-07-18 04:54:35 +0000 | [diff] [blame] | 211 | GenericValue executeFPTruncInst(Value *SrcVal, Type *DstTy, |
Reid Spencer | 7a9c62b | 2007-01-12 07:05:14 +0000 | [diff] [blame] | 212 | ExecutionContext &SF); |
Chris Lattner | 229907c | 2011-07-18 04:54:35 +0000 | [diff] [blame] | 213 | GenericValue executeFPExtInst(Value *SrcVal, Type *DstTy, |
Reid Spencer | 7a9c62b | 2007-01-12 07:05:14 +0000 | [diff] [blame] | 214 | ExecutionContext &SF); |
Chris Lattner | 229907c | 2011-07-18 04:54:35 +0000 | [diff] [blame] | 215 | GenericValue executeFPToUIInst(Value *SrcVal, Type *DstTy, |
Reid Spencer | 7a9c62b | 2007-01-12 07:05:14 +0000 | [diff] [blame] | 216 | ExecutionContext &SF); |
Chris Lattner | 229907c | 2011-07-18 04:54:35 +0000 | [diff] [blame] | 217 | GenericValue executeFPToSIInst(Value *SrcVal, Type *DstTy, |
Reid Spencer | 7a9c62b | 2007-01-12 07:05:14 +0000 | [diff] [blame] | 218 | ExecutionContext &SF); |
Chris Lattner | 229907c | 2011-07-18 04:54:35 +0000 | [diff] [blame] | 219 | GenericValue executeUIToFPInst(Value *SrcVal, Type *DstTy, |
Reid Spencer | 7a9c62b | 2007-01-12 07:05:14 +0000 | [diff] [blame] | 220 | ExecutionContext &SF); |
Chris Lattner | 229907c | 2011-07-18 04:54:35 +0000 | [diff] [blame] | 221 | GenericValue executeSIToFPInst(Value *SrcVal, Type *DstTy, |
Reid Spencer | 7a9c62b | 2007-01-12 07:05:14 +0000 | [diff] [blame] | 222 | ExecutionContext &SF); |
Chris Lattner | 229907c | 2011-07-18 04:54:35 +0000 | [diff] [blame] | 223 | GenericValue executePtrToIntInst(Value *SrcVal, Type *DstTy, |
Reid Spencer | 7a9c62b | 2007-01-12 07:05:14 +0000 | [diff] [blame] | 224 | ExecutionContext &SF); |
Chris Lattner | 229907c | 2011-07-18 04:54:35 +0000 | [diff] [blame] | 225 | GenericValue executeIntToPtrInst(Value *SrcVal, Type *DstTy, |
Reid Spencer | 7a9c62b | 2007-01-12 07:05:14 +0000 | [diff] [blame] | 226 | ExecutionContext &SF); |
Chris Lattner | 229907c | 2011-07-18 04:54:35 +0000 | [diff] [blame] | 227 | GenericValue executeBitCastInst(Value *SrcVal, Type *DstTy, |
Reid Spencer | 7a9c62b | 2007-01-12 07:05:14 +0000 | [diff] [blame] | 228 | ExecutionContext &SF); |
Reid Spencer | 6c38f0b | 2006-11-27 01:05:10 +0000 | [diff] [blame] | 229 | GenericValue executeCastOperation(Instruction::CastOps opcode, Value *SrcVal, |
Chris Lattner | 229907c | 2011-07-18 04:54:35 +0000 | [diff] [blame] | 230 | Type *Ty, ExecutionContext &SF); |
| 231 | void popStackAndReturnValueToCaller(Type *RetTy, GenericValue Result); |
Reid Spencer | 10fe0e0 | 2007-01-18 02:12:10 +0000 | [diff] [blame] | 232 | |
Chris Lattner | d7ff578 | 2001-08-23 17:05:04 +0000 | [diff] [blame] | 233 | }; |
| 234 | |
Brian Gaeke | 960707c | 2003-11-11 22:41:34 +0000 | [diff] [blame] | 235 | } // End llvm namespace |
| 236 | |
Chris Lattner | d7ff578 | 2001-08-23 17:05:04 +0000 | [diff] [blame] | 237 | #endif |