LegalizeTypes can sometimes have deleted nodes
[oota-llvm.git] / docs / tutorial / LangImpl5.html
index 8672cdd00f3d377e822ce565cfab6371a09aebd6..8081fc3821af1693b36f2d6c70b0a162944694fb 100644 (file)
@@ -400,7 +400,7 @@ other two blocks are created, but aren't yet inserted into the function.</p>
 
 <p>Once the blocks are created, we can emit the conditional branch that chooses
 between them.  Note that creating new blocks does not implicitly affect the
-LLVMBuilder, so it is still inserting into the block that the condition
+IRBuilder, so it is still inserting into the block that the condition
 went into.  Also note that it is creating a branch to the "then" block and the
 "else" block, even though the "else" block isn't inserted into the function yet.
 This is all ok: it is the standard way that LLVM supports forward 
@@ -907,7 +907,7 @@ if/then/else and for expressions..  To build this example, use:
 #include "llvm/Analysis/Verifier.h"
 #include "llvm/Target/TargetData.h"
 #include "llvm/Transforms/Scalar.h"
-#include "llvm/Support/LLVMBuilder.h"
+#include "llvm/Support/IRBuilder.h"
 #include &lt;cstdio&gt;
 #include &lt;string&gt;
 #include &lt;map&gt;
@@ -1352,7 +1352,7 @@ static PrototypeAST *ParseExtern() {
 //===----------------------------------------------------------------------===//
 
 static Module *TheModule;
-static LLVMFoldingBuilder Builder;
+static IRBuilder Builder;
 static std::map&lt;std::string, Value*&gt; NamedValues;
 static FunctionPassManager *TheFPM;
 
@@ -1735,16 +1735,17 @@ int main() {
     MainLoop();
     
     TheFPM = 0;
-  }  // Free module provider and pass manager.
-                                   
+
+    // Print out all of the generated code.
+    TheModule-&gt;dump();
+  }  // Free module provider (and thus the module) and pass manager.
                                    
-  // Print out all of the generated code.
-  TheModule-&gt;dump();
   return 0;
 }
 </pre>
 </div>
 
+<a href="LangImpl6.html">Next: Extending the language: user-defined operators</a>
 </div>
 
 <!-- *********************************************************************** -->