virtual runOnFunction(Function& F) {
for (Function::iterator b = F.begin(), be = F.end(); b != be; ++b) {
- for (BasicBlock::iterator i = b->begin(); ie = b->end(); i != ie; ++i) {
+ for (BasicBlock::iterator i = b->begin(), ie = b->end(); i != ie; ++i) {
if (<a href="#CallInst">CallInst</a>* callInst = <a href="#isa">dyn_cast</a><<a
href="#CallInst">CallInst</a>>(&*i)) {
// <i>We know we've encountered a call instruction, so we</i>
<ul>
<li><tt>ReplaceInstWithValue</tt>
- <p>This function replaces all uses (within a basic block) of a given
- instruction with a value, and then removes the original instruction. The
- following example illustrates the replacement of the result of a particular
+ <p>This function replaces all uses of a given instruction with a value,
+ and then removes the original instruction. The following example
+ illustrates the replacement of the result of a particular
<tt>AllocaInst</tt> that allocates memory for a single integer with a null
pointer to an integer.</p>
BasicBlock::iterator ii(instToReplace);
ReplaceInstWithValue(instToReplace->getParent()->getInstList(), ii,
- Constant::getNullValue(PointerType::get(Type::Int32Ty)));
+ Constant::getNullValue(PointerType::getUnqual(Type::Int32Ty)));
</pre></div></li>
<li><tt>ReplaceInstWithInst</tt>
<p>This function replaces a particular instruction with another
- instruction. The following example illustrates the replacement of one
- <tt>AllocaInst</tt> with another.</p>
+ instruction, inserting the new instruction into the basic block at the
+ location where the old instruction was, and replacing any uses of the old
+ instruction with the new instruction. The following example illustrates
+ the replacement of one <tt>AllocaInst</tt> with another.</p>
<div class="doc_code">
<pre>
// <i>Create the initial outer struct</i>
<a href="#PATypeHolder">PATypeHolder</a> StructTy = OpaqueType::get();
std::vector<const Type*> Elts;
-Elts.push_back(PointerType::get(StructTy));
+Elts.push_back(PointerType::getUnqual(StructTy));
Elts.push_back(Type::Int32Ty);
StructType *NewSTy = StructType::get(Elts);
will automatically be inserted into that module's list of
functions.</p></li>
- <li><tt>bool isExternal()</tt>
+ <li><tt>bool isDeclaration()</tt>
<p>Return whether or not the <tt>Function</tt> has a body defined. If the
function is "external", it does not have a body, and thus must be resolved