Grammar fix.
[oota-llvm.git] / docs / tutorial / LangImpl4.html
index 41b58c76e0397392478c1a017b465a819e3ae98f..b956260628839b27aaf6f51cb56c368928b6c5a9 100644 (file)
@@ -123,7 +123,7 @@ entry:
 
 <p>In this case, the LHS and RHS of the multiplication are the same value.  We'd
 really like to see this generate "<tt>tmp = x+3; result = tmp*tmp;</tt>" instead
-of computing "<tt>x*3</tt>" twice.</p>
+of computing "<tt>x+3</tt>" twice.</p>
 
 <p>Unfortunately, no amount of local analysis will be able to detect and correct
 this.  This requires two transformations: reassociation of expressions (to 
@@ -714,7 +714,7 @@ static ExprAST *ParseIdentifierExpr() {
       if (CurTok == ')') break;
     
       if (CurTok != ',')
-        return Error("Expected ')'");
+        return Error("Expected ')' or ',' in argument list");
       getNextToken();
     }
   }
@@ -913,7 +913,7 @@ Function *PrototypeAST::Codegen() {
   std::vector&lt;const Type*&gt; Doubles(Args.size(), Type::DoubleTy);
   FunctionType *FT = FunctionType::get(Type::DoubleTy, Doubles, false);
   
-  Function *F = new Function(FT, Function::ExternalLinkage, Name, TheModule);
+  Function *F = Function::Create(FT, Function::ExternalLinkage, Name, TheModule);
   
   // If F conflicted, there was already something named 'Name'.  If it has a
   // body, don't allow redefinition or reextern.
@@ -956,7 +956,7 @@ Function *FunctionAST::Codegen() {
     return 0;
   
   // Create a new basic block to start insertion into.
-  BasicBlock *BB = new BasicBlock("entry", TheFunction);
+  BasicBlock *BB = BasicBlock::Create("entry", TheFunction);
   Builder.SetInsertPoint(BB);
   
   if (Value *RetVal = Body-&gt;Codegen()) {