mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +02:00
add a stub of a lowering pass
This commit is contained in:
parent
479b5e9b5d
commit
f625c6d1d0
4 changed files with 35 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
17
src/mesa/pipe/llvm/loweringpass.cpp
Normal file
17
src/mesa/pipe/llvm/loweringpass.cpp
Normal file
|
|
@ -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;
|
||||
}
|
||||
15
src/mesa/pipe/llvm/loweringpass.h
Normal file
15
src/mesa/pipe/llvm/loweringpass.h
Normal file
|
|
@ -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
|
||||
Loading…
Add table
Reference in a new issue