Make test work on non-x86 machines (like my G4 PPC).
[oota-llvm.git] / docs / tutorial / LangImpl4.html
index ddd609210d8d9ff1a237f269b3e819269f8ad415..8f5e054cec9cf27d16da7b79a22c931a97a7cfa8 100644 (file)
@@ -863,7 +863,7 @@ static FunctionPassManager *TheFPM;
 Value *ErrorV(const char *Str) { Error(Str); return 0; }
 
 Value *NumberExprAST::Codegen() {
-  return ConstantFP::get(Type::DoubleTy, APFloat(Val));
+  return ConstantFP::get(APFloat(Val));
 }
 
 Value *VariableExprAST::Codegen() {
@@ -913,7 +913,7 @@ Function *PrototypeAST::Codegen() {
   std::vector<const Type*> 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->Codegen()) {