mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-04 05:31:51 +00:00
Fixed typos and added </>/& tags where appropriate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3610 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2b76306eb7
commit
72ef35ea5f
@ -229,8 +229,8 @@ contains:
|
||||
// print out the name of the basic block if it has one, and then the
|
||||
// number of instructions that it contains
|
||||
|
||||
cerr << "Basic block (name=" << i->getName() << ") has "
|
||||
<< i->size() << " instructions.\n";
|
||||
cerr << "Basic block (name=" << i->getName() << ") has "
|
||||
<< i->size() << " instructions.\n";
|
||||
}
|
||||
</pre>
|
||||
|
||||
@ -308,7 +308,7 @@ still need the following in order for things to work properly:
|
||||
|
||||
<pre>
|
||||
BasicBlock::iterator bbi = ...;
|
||||
BranchInst* b = dyn_cast<BranchInst>(&*bbi);
|
||||
BranchInst* b = dyn_cast<BranchInst>(&*bbi);
|
||||
</pre>
|
||||
|
||||
The following code snippet illustrates use of the conversion
|
||||
@ -320,14 +320,14 @@ it via iteration over some structure:
|
||||
void printNextInstruction(Instruction* inst) {
|
||||
BasicBlock::iterator it(inst);
|
||||
++it; // after this line, it refers to the instruction after *inst.
|
||||
if(it != inst->getParent()->end()) cerr << *it << endl;
|
||||
if(it != inst->getParent()->end()) cerr << *it << endl;
|
||||
}
|
||||
</pre>
|
||||
|
||||
Of course, this example is strictly pedagogical, because it'd be
|
||||
better to do something like
|
||||
|
||||
<pre>if(inst->getNext()) cerr << inst->getNext() << endl;</pre>
|
||||
<pre>if(inst->getNext()) cerr << inst->getNext() << endl;</pre>
|
||||
|
||||
|
||||
<!-- dereferenced iterator = Class &
|
||||
@ -368,7 +368,7 @@ has to override the <tt>runOnFunction</tt> method...):
|
||||
// Assume callCounter is a private member of the pass class being written,
|
||||
// and has been initialized in the pass class constructor.
|
||||
|
||||
virtual runOnFunction(Function& F) {
|
||||
virtual runOnFunction(Function& F) {
|
||||
|
||||
// Remember, we assumed that the signature of foo was "int foo(int)";
|
||||
// the first thing we'll do is grab the pointer to that function (as a
|
||||
@ -380,17 +380,17 @@ virtual runOnFunction(Function& F) {
|
||||
vector<const Type*> params;
|
||||
params.push_back(Type::IntTy);
|
||||
const FunctionType* fooType = FunctionType::get(Type::IntTy, params);
|
||||
Function* foo = F.getParent()->getOrInsertFunction("foo", fooType);
|
||||
Function* foo = F.getParent()->getOrInsertFunction("foo", fooType);
|
||||
|
||||
// Start iterating and (as per the pseudocode), increment callCounter.
|
||||
|
||||
for(Function::iterator b = F.begin(), be = F.end(); b != be; ++b) {
|
||||
for(BasicBlock::iterator i = b->begin(); ie = b->end(); i != ie; ++i) {
|
||||
if(CallInst* callInst = dyn_cast<CallInst>(&*inst)) {
|
||||
for(BasicBlock::iterator i = b->begin(); ie = b->end(); i != ie; ++i) {
|
||||
if(CallInst* callInst = dyn_cast<CallInst>(&*inst)) {
|
||||
// we know we've encountered a call instruction, so we
|
||||
// need to determine if it's a call to foo or not
|
||||
|
||||
if(callInst->getCalledFunction() == foo)
|
||||
if(callInst->getCalledFunction() == foo)
|
||||
++callCounter;
|
||||
}
|
||||
}
|
||||
@ -1243,6 +1243,6 @@ pointer to the parent Function.
|
||||
<a href="mailto:sabre@nondot.org">Chris Lattner</a></address>
|
||||
<!-- Created: Tue Aug 6 15:00:33 CDT 2002 -->
|
||||
<!-- hhmts start -->
|
||||
Last modified: Fri Sep 6 17:12:14 CDT 2002
|
||||
Last modified: Fri Sep 6 18:03:31 EDT 2002
|
||||
<!-- hhmts end -->
|
||||
</font></body></html>
|
||||
|
Loading…
x
Reference in New Issue
Block a user