LegalizeTypes can sometimes have deleted nodes
[oota-llvm.git] / docs / tutorial / LangImpl6.html
index 013da2e753f66c0568d89cbb34b31dd9e898cff3..1f159e0b56d51fd88b38e2a76abee653af17e1ff 100644 (file)
@@ -827,7 +827,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 <cstdio>
 #include <string>
 #include <map>
@@ -1357,7 +1357,7 @@ static PrototypeAST *ParseExtern() {
 //===----------------------------------------------------------------------===//
 
 static Module *TheModule;
-static LLVMFoldingBuilder Builder;
+static IRBuilder Builder;
 static std::map<std::string, Value*> NamedValues;
 static FunctionPassManager *TheFPM;
 
@@ -1774,16 +1774,17 @@ int main() {
     MainLoop();
     
     TheFPM = 0;
-  }  // Free module provider and pass manager.
-                                   
-                                   
-  // Print out all of the generated code.
-  TheModule->dump();
+    
+    // Print out all of the generated code.
+    TheModule->dump();
+  }  // Free module provider (and thus the module) and pass manager.
+  
   return 0;
 }
 </pre>
 </div>
 
+<a href="LangImpl7.html">Next: Extending the language: mutable variables / SSA construction</a>
 </div>
 
 <!-- *********************************************************************** -->