GALLIVM_SOURCES = \
gallivm.cpp \
instructions.cpp \
+ loweringpass.cpp \
storage.cpp
INC_SOURCES = gallivm_builtins.cpp llvm_base_shader.cpp
#include "gallivm.h"
#include "instructions.h"
+#include "loweringpass.h"
#include "storage.h"
#include "pipe/p_context.h"
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
--- /dev/null
+#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;
+}
--- /dev/null
+#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