diff options
| author | Zack Rusin <zack@tungstengraphics.com> | 2008-01-25 06:36:35 -0500 | 
|---|---|---|
| committer | Ben Skeggs <skeggsb@gmail.com> | 2008-02-15 13:51:09 +1100 | 
| commit | 474f1a1d56fbb5472dd9bbf5828c413ae7e629dd (patch) | |
| tree | 9df7ee352763c6602594d90191a9ab30e4580c84 /src/mesa | |
| parent | ce358b879c1823ab4fa04f56e208d679792667cc (diff) | |
add a stub of a lowering pass
Diffstat (limited to 'src/mesa')
| -rw-r--r-- | src/mesa/pipe/llvm/Makefile | 1 | ||||
| -rw-r--r-- | src/mesa/pipe/llvm/gallivm.cpp | 2 | ||||
| -rw-r--r-- | src/mesa/pipe/llvm/loweringpass.cpp | 17 | ||||
| -rw-r--r-- | src/mesa/pipe/llvm/loweringpass.h | 15 | 
4 files changed, 35 insertions, 0 deletions
| diff --git a/src/mesa/pipe/llvm/Makefile b/src/mesa/pipe/llvm/Makefile index f655fb8340..1e3ae988df 100644 --- a/src/mesa/pipe/llvm/Makefile +++ b/src/mesa/pipe/llvm/Makefile @@ -8,6 +8,7 @@ LIBNAME = gallivm  GALLIVM_SOURCES = \          gallivm.cpp  \          instructions.cpp  \ +        loweringpass.cpp \          storage.cpp  INC_SOURCES = gallivm_builtins.cpp llvm_base_shader.cpp diff --git a/src/mesa/pipe/llvm/gallivm.cpp b/src/mesa/pipe/llvm/gallivm.cpp index afa1446890..46e11c185a 100644 --- a/src/mesa/pipe/llvm/gallivm.cpp +++ b/src/mesa/pipe/llvm/gallivm.cpp @@ -34,6 +34,7 @@  #include "gallivm.h"  #include "instructions.h" +#include "loweringpass.h"  #include "storage.h"  #include "pipe/p_context.h" @@ -95,6 +96,7 @@ using namespace llvm;  static int GLOBAL_ID = 0;  static inline void AddStandardCompilePasses(PassManager &PM) { +   PM.add(new LoweringPass());     PM.add(createVerifierPass());                  // Verify that input is correct     PM.add(createLowerSetJmpPass());          // Lower llvm.setjmp/.longjmp diff --git a/src/mesa/pipe/llvm/loweringpass.cpp b/src/mesa/pipe/llvm/loweringpass.cpp new file mode 100644 index 0000000000..556dbec366 --- /dev/null +++ b/src/mesa/pipe/llvm/loweringpass.cpp @@ -0,0 +1,17 @@ +#include "loweringpass.h" + +using namespace llvm; + +char LoweringPass::ID = 0; +RegisterPass<LoweringPass> X("lowering", "Lowering Pass"); + +LoweringPass::LoweringPass() +   :  ModulePass((intptr_t)&ID) +{ +} + +bool LoweringPass::runOnModule(Module &m) +{ +   llvm::cerr << "Hello: " << m.getModuleIdentifier() << "\n"; +   return false; +} diff --git a/src/mesa/pipe/llvm/loweringpass.h b/src/mesa/pipe/llvm/loweringpass.h new file mode 100644 index 0000000000..f62dcf6ba7 --- /dev/null +++ b/src/mesa/pipe/llvm/loweringpass.h @@ -0,0 +1,15 @@ +#ifndef LOWERINGPASS_H +#define LOWERINGPASS_H + +#include "llvm/Pass.h" +#include "llvm/Module.h" + +struct LoweringPass : public llvm::ModulePass +{ +   static char ID; +   LoweringPass(); + +   virtual bool runOnModule(llvm::Module &m); +}; + +#endif | 
