aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-03-29 06:32:46 +0000
committerChris Lattner <sabre@nondot.org>2009-03-29 06:32:46 +0000
commitba315c1ee7bef78c6824441fe6c1761596ec9880 (patch)
treee5e99af30114728a450554f971b261ba469434d4 /include
parent2491e4657d95f7ff61fb2a741ba9996e492df515 (diff)
downloadexternal_llvm-ba315c1ee7bef78c6824441fe6c1761596ec9880.zip
external_llvm-ba315c1ee7bef78c6824441fe6c1761596ec9880.tar.gz
external_llvm-ba315c1ee7bef78c6824441fe6c1761596ec9880.tar.bz2
add helper method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67989 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/ADT/PointerUnion.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/llvm/ADT/PointerUnion.h b/include/llvm/ADT/PointerUnion.h
index 8ea1315..7a4de65 100644
--- a/include/llvm/ADT/PointerUnion.h
+++ b/include/llvm/ADT/PointerUnion.h
@@ -78,6 +78,8 @@ namespace llvm {
Val.setInt(1);
}
+ bool isNull() const { return Val.getPointer() == 0; }
+
template<typename T>
int is() const {
return Val.getInt() == ::llvm::getPointerUnionTypeNum<PT1, PT2>((T*)0);