add helper method.
authorChris Lattner <sabre@nondot.org>
Sun, 29 Mar 2009 06:32:46 +0000 (06:32 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 29 Mar 2009 06:32:46 +0000 (06:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67989 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/PointerUnion.h

index 8ea1315a736e289e12354c6d58fae7a7cffafe5f..7a4de65656681fb480345e1196c21da8bf49516e 100644 (file)
@@ -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);