CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally.
[oota-llvm.git] / examples / BrainF / BrainF.h
index 03eedbc3a2530ba5ab9916108f2f83910f977b00..add0687d54a631a7643f94cb45dddf76f39628ae 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by Sterling Stein and is distributed under the
-// University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===--------------------------------------------------------------------===//
 //
@@ -15,8 +15,9 @@
 #ifndef BRAINF_H
 #define BRAINF_H
 
+#include "llvm/LLVMContext.h"
 #include "llvm/Module.h"
-#include "llvm/Support/LLVMBuilder.h"
+#include "llvm/Support/IRBuilder.h"
 
 using namespace llvm;
 
@@ -38,7 +39,8 @@ class BrainF {
     /// containing the resulting code.
     /// On error, it calls abort.
     /// The caller must delete the returned module.
-    Module *parse(std::istream *in1, int mem, CompileFlags cf);
+    Module *parse(std::istream *in1, int mem, CompileFlags cf,
+                  LLVMContext& C);
 
   protected:
     /// The different symbols in the BrainF language
@@ -64,11 +66,12 @@ class BrainF {
     static const char *testreg;
 
     /// Put the brainf function preamble and other fixed pieces of code
-    void header();
+    void header(LLVMContext& C);
 
     /// The main loop for parsing.  It calls itself recursively
     /// to handle the depth of nesting of "[]".
-    void readloop(PHINode *phi, BasicBlock *oldbb, BasicBlock *testbb);
+    void readloop(PHINode *phi, BasicBlock *oldbb,
+                  BasicBlock *testbb, LLVMContext &Context);
 
     /// Constants during parsing
     int memtotal;
@@ -84,7 +87,7 @@ class BrainF {
     BasicBlock *aberrorbb;
 
     /// Variables
-    LLVMBuilder *builder;
+    IRBuilder<> *builder;
     Value *curhead;
 };