summaryrefslogtreecommitdiff
path: root/include/llvm
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2014-01-19 02:13:50 +0000
committerChandler Carruth <chandlerc@gmail.com>2014-01-19 02:13:50 +0000
commit60e425e99ba7ef05b7a52c7068a67c6baa25da38 (patch)
treea9ebb901ce4706d01180fb0021cc10ec1a561b88 /include/llvm
parente952af7ae522e4e372fe486e1124d7ff0821ab33 (diff)
downloadllvm-60e425e99ba7ef05b7a52c7068a67c6baa25da38.tar.gz
llvm-60e425e99ba7ef05b7a52c7068a67c6baa25da38.tar.bz2
llvm-60e425e99ba7ef05b7a52c7068a67c6baa25da38.tar.xz
Add a const lookup routine to get a BlockAddress constant if there is
one, but not create one. This is useful in the verifier when we want to query the constant if it exists but not create one. To be used in an upcoming commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199568 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/IR/Constants.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/IR/Constants.h b/include/llvm/IR/Constants.h
index 1acf5b6cc8..448d82931a 100644
--- a/include/llvm/IR/Constants.h
+++ b/include/llvm/IR/Constants.h
@@ -757,6 +757,12 @@ public:
/// block must be embedded into a function.
static BlockAddress *get(BasicBlock *BB);
+ /// \brief Lookup an existing \c BlockAddress constant for the given
+ /// BasicBlock.
+ ///
+ /// \returns 0 if \c !BB->hasAddressTaken(), otherwise the \c BlockAddress.
+ static BlockAddress *lookup(const BasicBlock *BB);
+
/// Transparently provide more efficient getOperand methods.
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);