From d6c1ed08f69eb1fb3bec7cba6bee866dec5f18f7 Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Wed, 11 Mar 2009 19:51:07 +0000 Subject: [PATCH] Fix exaples using IRBuilder. Thanks, Quadrescence and Glip7 from IRC! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66687 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/tutorial/JITTutorial1.html | 2 +- docs/tutorial/JITTutorial2.html | 2 +- docs/tutorial/LangImpl3.html | 8 ++++---- docs/tutorial/LangImpl4.html | 2 +- docs/tutorial/LangImpl5.html | 2 +- docs/tutorial/LangImpl6.html | 2 +- docs/tutorial/LangImpl7.html | 6 +++--- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/tutorial/JITTutorial1.html b/docs/tutorial/JITTutorial1.html index 3f0e7c18649..4aec470c7a9 100644 --- a/docs/tutorial/JITTutorial1.html +++ b/docs/tutorial/JITTutorial1.html @@ -153,7 +153,7 @@ function will interoperate properly with C code, which is a good thing.

   BasicBlock* block = BasicBlock::Create("entry", mul_add);
-  IRBuilder builder(block);
+  IRBuilder<> builder(block);
 
diff --git a/docs/tutorial/JITTutorial2.html b/docs/tutorial/JITTutorial2.html index 262457274d0..c9adda13438 100644 --- a/docs/tutorial/JITTutorial2.html +++ b/docs/tutorial/JITTutorial2.html @@ -111,7 +111,7 @@ Module* makeLLVMModule() {
-  IRBuilder builder(entry);
+  IRBuilder<> builder(entry);
   Value* xEqualsY = builder.CreateICmpEQ(x, y, "tmp");
   builder.CreateCondBr(xEqualsY, ret, cond_false);
 
diff --git a/docs/tutorial/LangImpl3.html b/docs/tutorial/LangImpl3.html index 2acd3ddb531..faf11d0592b 100644 --- a/docs/tutorial/LangImpl3.html +++ b/docs/tutorial/LangImpl3.html @@ -115,7 +115,7 @@ undeclared parameter):

Value *ErrorV(const char *Str) { Error(Str); return 0; } static Module *TheModule; -static IRBuilder Builder; +static IRBuilder<> Builder; static std::map<std::string, Value*> NamedValues;
@@ -128,8 +128,8 @@ uses to contain code.

The Builder object is a helper object that makes it easy to generate LLVM instructions. Instances of the IRBuilder -class keep track of the current place to insert instructions and has methods to -create new instructions.

+class template keep track of the current place to insert instructions and has +methods to create new instructions.

The NamedValues map keeps track of which values are defined in the current scope and what their LLVM representation is. (In other words, it is a @@ -1027,7 +1027,7 @@ static PrototypeAST *ParseExtern() { //===----------------------------------------------------------------------===// static Module *TheModule; -static IRBuilder Builder; +static IRBuilder<> Builder; static std::map<std::string, Value*> NamedValues; Value *ErrorV(const char *Str) { Error(Str); return 0; } diff --git a/docs/tutorial/LangImpl4.html b/docs/tutorial/LangImpl4.html index 95a8b6dd6a1..7e1fcfa0ff5 100644 --- a/docs/tutorial/LangImpl4.html +++ b/docs/tutorial/LangImpl4.html @@ -861,7 +861,7 @@ static PrototypeAST *ParseExtern() { //===----------------------------------------------------------------------===// static Module *TheModule; -static IRBuilder Builder; +static IRBuilder<> Builder; static std::map<std::string, Value*> NamedValues; static FunctionPassManager *TheFPM; diff --git a/docs/tutorial/LangImpl5.html b/docs/tutorial/LangImpl5.html index 0075d60c0bd..bf96b460465 100644 --- a/docs/tutorial/LangImpl5.html +++ b/docs/tutorial/LangImpl5.html @@ -1352,7 +1352,7 @@ static PrototypeAST *ParseExtern() { //===----------------------------------------------------------------------===// static Module *TheModule; -static IRBuilder Builder; +static IRBuilder<> Builder; static std::map<std::string, Value*> NamedValues; static FunctionPassManager *TheFPM; diff --git a/docs/tutorial/LangImpl6.html b/docs/tutorial/LangImpl6.html index 39febee6539..44ad15b0096 100644 --- a/docs/tutorial/LangImpl6.html +++ b/docs/tutorial/LangImpl6.html @@ -1357,7 +1357,7 @@ static PrototypeAST *ParseExtern() { //===----------------------------------------------------------------------===// static Module *TheModule; -static IRBuilder Builder; +static IRBuilder<> Builder; static std::map<std::string, Value*> NamedValues; static FunctionPassManager *TheFPM; diff --git a/docs/tutorial/LangImpl7.html b/docs/tutorial/LangImpl7.html index e146e561637..f5606484eb9 100644 --- a/docs/tutorial/LangImpl7.html +++ b/docs/tutorial/LangImpl7.html @@ -422,7 +422,7 @@ function:

/// the function. This is used for mutable variables etc. static AllocaInst *CreateEntryBlockAlloca(Function *TheFunction, const std::string &VarName) { - IRBuilder TmpB(&TheFunction->getEntryBlock(), + IRBuilder<> TmpB(&TheFunction->getEntryBlock(), TheFunction->getEntryBlock().begin()); return TmpB.CreateAlloca(Type::DoubleTy, 0, VarName.c_str()); } @@ -1605,7 +1605,7 @@ static PrototypeAST *ParseExtern() { //===----------------------------------------------------------------------===// static Module *TheModule; -static IRBuilder Builder; +static IRBuilder<> Builder; static std::map<std::string, AllocaInst*> NamedValues; static FunctionPassManager *TheFPM; @@ -1615,7 +1615,7 @@ Value *ErrorV(const char *Str) { Error(Str); return 0; } /// the function. This is used for mutable variables etc. static AllocaInst *CreateEntryBlockAlloca(Function *TheFunction, const std::string &VarName) { - IRBuilder TmpB(&TheFunction->getEntryBlock(), + IRBuilder<> TmpB(&TheFunction->getEntryBlock(), TheFunction->getEntryBlock().begin()); return TmpB.CreateAlloca(Type::DoubleTy, 0, VarName.c_str()); } -- 2.34.1