make hasAddressTaken() constant time by storing a refcount in BB's subclass data.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85625 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2009-10-30 22:33:29 +00:00
parent 57f224a5a4
commit 3821176b2e
3 changed files with 18 additions and 15 deletions
-8
View File
@@ -278,11 +278,3 @@ BasicBlock *BasicBlock::splitBasicBlock(iterator I, const Twine &BBName) {
return New;
}
/// hasAddressTaken - returns true if there are any uses of this basic block
/// other than direct branches, switches, etc. to it.
bool BasicBlock::hasAddressTaken() const {
for (Value::use_const_iterator I = use_begin(), E = use_end(); I != E; ++I)
if (isa<BlockAddress>(*I))
return true;
return false;
}