diff options
author | Joel Stanley <jstanley@cs.uiuc.edu> | 2002-09-06 23:05:12 +0000 |
---|---|---|
committer | Joel Stanley <jstanley@cs.uiuc.edu> | 2002-09-06 23:05:12 +0000 |
commit | 72ef35ea5f4d53e94160f21bc8fa0412b7774301 (patch) | |
tree | bd4d72a468a128abe2af9da19f291a3d74354b86 /docs/ProgrammersManual.html | |
parent | 2b76306eb7ab0f8981446da96b5340ed5fb814ef (diff) |
Fixed typos and added </>/& tags where appropriate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3610 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/ProgrammersManual.html')
-rw-r--r-- | docs/ProgrammersManual.html | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/docs/ProgrammersManual.html b/docs/ProgrammersManual.html index 945ac98755..4f458fac55 100644 --- a/docs/ProgrammersManual.html +++ b/docs/ProgrammersManual.html @@ -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> |