diff options
author | Dan Gohman <gohman@apple.com> | 2009-10-29 00:09:08 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-10-29 00:09:08 +0000 |
commit | d50a560f876bc526b57305c5ec1b3478f8cb97b3 (patch) | |
tree | 7cc7c5250a5e61268681af23f695dba1699a0440 /lib/VMCore | |
parent | 30f4c269dd65e2abaaf718261410fd7c768dfc86 (diff) | |
download | external_llvm-d50a560f876bc526b57305c5ec1b3478f8cb97b3.zip external_llvm-d50a560f876bc526b57305c5ec1b3478f8cb97b3.tar.gz external_llvm-d50a560f876bc526b57305c5ec1b3478f8cb97b3.tar.bz2 |
Add a hasAddressTaken for BasicBlock.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85449 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/BasicBlock.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/VMCore/BasicBlock.cpp b/lib/VMCore/BasicBlock.cpp index 50cf84c..ede2d12 100644 --- a/lib/VMCore/BasicBlock.cpp +++ b/lib/VMCore/BasicBlock.cpp @@ -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; +} |