diff options
author | Zack Rusin <[email protected]> | 2007-10-30 09:00:36 -0400 |
---|---|---|
committer | Zack Rusin <[email protected]> | 2007-10-30 09:00:36 -0400 |
commit | 449562cde0008c755d20b3de83cbd3266bc001ac (patch) | |
tree | ea44118b5f8b0a22c4017d473c407a8ff990488d /src/mesa/pipe/llvm/instructions.h | |
parent | c97c03da46292abe72f94747fe527eb4e4623248 (diff) |
Switch to using LLVM builder.
Instead of creating all the instructions by hand, switching
to using LLVMBuilder.
Diffstat (limited to 'src/mesa/pipe/llvm/instructions.h')
-rw-r--r-- | src/mesa/pipe/llvm/instructions.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/mesa/pipe/llvm/instructions.h b/src/mesa/pipe/llvm/instructions.h index 85ffc7b9205..83d07e2f2e2 100644 --- a/src/mesa/pipe/llvm/instructions.h +++ b/src/mesa/pipe/llvm/instructions.h @@ -36,6 +36,7 @@ #include <llvm/BasicBlock.h> #include <llvm/Module.h> #include <llvm/Value.h> +#include <llvm/Support/LLVMBuilder.h> #include <map> #include <stack> @@ -50,7 +51,8 @@ class Storage; class Instructions { public: - Instructions(llvm::Module *mod, llvm::Function *func, llvm::BasicBlock *block); + Instructions(llvm::Module *mod, llvm::Function *func, llvm::BasicBlock *block, + Storage *storage); llvm::BasicBlock *currentBlock() const; @@ -58,7 +60,7 @@ public: llvm::Value *arl(llvm::Value *in1); llvm::Value *add(llvm::Value *in1, llvm::Value *in2); void beginLoop(); - void bgnSub(unsigned, Storage *); + void bgnSub(unsigned); void brk(); void cal(int label, llvm::Value *out, llvm::Value *in, llvm::Value *cst, llvm::Value *tmp); @@ -116,11 +118,11 @@ private: std::vector<llvm::Value*> extractVector(llvm::Value *vec); private: - llvm::Module *m_mod; - llvm::Function *m_func; - char m_name[32]; - llvm::BasicBlock *m_block; - int m_idx; + llvm::Module *m_mod; + llvm::Function *m_func; + char m_name[32]; + llvm::LLVMFoldingBuilder m_builder; + int m_idx; llvm::VectorType *m_floatVecType; @@ -140,6 +142,7 @@ private: }; std::stack<Loop> m_loopStack; std::map<int, llvm::Function*> m_functions; + Storage *m_storage; }; #endif |