llvm.org GIT mirror llvm / 6a54710
Remove documented problem that is now fixed git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5869 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 17 years ago
1 changed file(s) with 2 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
271271

                  
                
272272 // Loop over all of the phi nodes in a basic block
273273 BasicBlock::iterator BBI = BB->begin();
274 for (; PHINode *PN = dyn_cast<PHINode>(&*BBI); ++BBI)
274 for (; PHINode *PN = dyn_cast<PHINode>(BBI); ++BBI)
275275 cerr << *PN;
276276

277277
615615 is semantically equivalent to
616616
617617
Instruction* pinst = i;
618
619 Caveat emptor: The above syntax works only when you're not
620 working with dyn_cast. The template definition of
621 href="#isa">dyn_cast isn't implemented to handle this yet, so you'll
622 still need the following in order for things to work properly:
623
624

                  
                
625 BasicBlock::iterator bbi = ...;
626 BranchInst* b = dyn_cast<BranchInst>(&*bbi);
627
628618
629619 It's also possible to turn a class pointer into the corresponding
630620 iterator. Usually, this conversion is quite inexpensive. The
17441734 Chris Lattner
17451735
17461736
1747 Last modified: Mon Feb 24 14:45:19 CST 2003
1737 Last modified: Wed Apr 23 11:21:57 CDT 2003
17481738
17491739