Move a DenseMap's declaration outside of a loop, and just call
[oota-llvm.git] / examples / BrainF / BrainFDriver.cpp
index 3f3b6c339280d25dca3f7344f1b59d9e4ca16d7e..0a24d7b665f8919f61b762f011a296f6c192b824 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.
 //
 //===--------------------------------------------------------------------===//
 //
@@ -70,17 +70,17 @@ void addMainFunction(Module *mod) {
   }
 
   //main.0:
-  BasicBlock *bb = new BasicBlock("main.0", main_func);
+  BasicBlock *bb = BasicBlock::Create("main.0", main_func);
 
   //call void @brainf()
   {
-    CallInst *brainf_call = new CallInst(mod->getFunction("brainf"),
-                                         "", bb);
+    CallInst *brainf_call = CallInst::Create(mod->getFunction("brainf"),
+                                             "", bb);
     brainf_call->setTailCall(false);
   }
 
   //ret i32 0
-  new ReturnInst(ConstantInt::get(APInt(32, 0)), bb);
+  ReturnInst::Create(ConstantInt::get(APInt(32, 0)), bb);
 }
 
 int main(int argc, char **argv) {