1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

Add a hasAddressTaken for BasicBlock.

llvm-svn: 85449
This commit is contained in:
Dan Gohman 2009-10-29 00:09:08 +00:00
parent 64ba3671c9
commit c80f1a4033
2 changed files with 13 additions and 0 deletions

View File

@ -235,6 +235,10 @@ public:
/// keeping loop information consistent, use the SplitBlock utility function.
///
BasicBlock *splitBasicBlock(iterator I, const Twine &BBName = "");
/// hasAddressTaken - returns true if there are any uses of this basic block
/// other than direct branches, switches, etc. to it.
bool hasAddressTaken() const;
};
} // End llvm namespace

View File

@ -277,3 +277,12 @@ 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;
}