mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-03 17:31:50 +00:00
Add a hasAddressTaken for BasicBlock.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85449 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a809d2fb27
commit
eeb8ef1f37
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user