<div class="doc_code">
<pre>
BasicBlock* block = BasicBlock::Create("entry", mul_add);
<div class="doc_code">
<pre>
BasicBlock* block = BasicBlock::Create("entry", mul_add);
- IRBuilder builder(block);
+ IRBuilder<> builder(block);
<div class="doc_code">
<pre>
<div class="doc_code">
<pre>
- IRBuilder builder(entry);
+ IRBuilder<> builder(entry);
Value* xEqualsY = builder.CreateICmpEQ(x, y, "tmp");
builder.CreateCondBr(xEqualsY, ret, cond_false);
</pre>
Value* xEqualsY = builder.CreateICmpEQ(x, y, "tmp");
builder.CreateCondBr(xEqualsY, ret, cond_false);
</pre>
Value *ErrorV(const char *Str) { Error(Str); return 0; }
static Module *TheModule;
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;
</pre>
</div>
static std::map<std::string, Value*> NamedValues;
</pre>
</div>
<p>The <tt>Builder</tt> object is a helper object that makes it easy to generate
LLVM instructions. Instances of the <a
href="http://llvm.org/doxygen/IRBuilder_8h-source.html"><tt>IRBuilder</tt></a>
<p>The <tt>Builder</tt> object is a helper object that makes it easy to generate
LLVM instructions. Instances of the <a
href="http://llvm.org/doxygen/IRBuilder_8h-source.html"><tt>IRBuilder</tt></a>
-class keep track of the current place to insert instructions and has methods to
-create new instructions.</p>
+class template keep track of the current place to insert instructions and has
+methods to create new instructions.</p>
<p>The <tt>NamedValues</tt> map keeps track of which values are defined in the
current scope and what their LLVM representation is. (In other words, it is a
<p>The <tt>NamedValues</tt> map keeps track of which values are defined in the
current scope and what their LLVM representation is. (In other words, it is a
//===----------------------------------------------------------------------===//
static Module *TheModule;
//===----------------------------------------------------------------------===//
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; }
static std::map<std::string, Value*> NamedValues;
Value *ErrorV(const char *Str) { Error(Str); return 0; }
//===----------------------------------------------------------------------===//
static Module *TheModule;
//===----------------------------------------------------------------------===//
static Module *TheModule;
-static IRBuilder Builder;
+static IRBuilder<> Builder;
static std::map<std::string, Value*> NamedValues;
static FunctionPassManager *TheFPM;
static std::map<std::string, Value*> NamedValues;
static FunctionPassManager *TheFPM;
//===----------------------------------------------------------------------===//
static Module *TheModule;
//===----------------------------------------------------------------------===//
static Module *TheModule;
-static IRBuilder Builder;
+static IRBuilder<> Builder;
static std::map<std::string, Value*> NamedValues;
static FunctionPassManager *TheFPM;
static std::map<std::string, Value*> NamedValues;
static FunctionPassManager *TheFPM;
//===----------------------------------------------------------------------===//
static Module *TheModule;
//===----------------------------------------------------------------------===//
static Module *TheModule;
-static IRBuilder Builder;
+static IRBuilder<> Builder;
static std::map<std::string, Value*> NamedValues;
static FunctionPassManager *TheFPM;
static std::map<std::string, Value*> NamedValues;
static FunctionPassManager *TheFPM;
/// the function. This is used for mutable variables etc.
static AllocaInst *CreateEntryBlockAlloca(Function *TheFunction,
const std::string &VarName) {
/// 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());
}
TheFunction->getEntryBlock().begin());
return TmpB.CreateAlloca(Type::DoubleTy, 0, VarName.c_str());
}
//===----------------------------------------------------------------------===//
static Module *TheModule;
//===----------------------------------------------------------------------===//
static Module *TheModule;
-static IRBuilder Builder;
+static IRBuilder<> Builder;
static std::map<std::string, AllocaInst*> NamedValues;
static FunctionPassManager *TheFPM;
static std::map<std::string, AllocaInst*> NamedValues;
static FunctionPassManager *TheFPM;
/// the function. This is used for mutable variables etc.
static AllocaInst *CreateEntryBlockAlloca(Function *TheFunction,
const std::string &VarName) {
/// 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());
}
TheFunction->getEntryBlock().begin());
return TmpB.CreateAlloca(Type::DoubleTy, 0, VarName.c_str());
}