From: Chris Lattner Date: Sun, 29 Mar 2009 06:32:46 +0000 (+0000) Subject: add helper method. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ba315c1ee7bef78c6824441fe6c1761596ec9880;p=oota-llvm.git add helper method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67989 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/ADT/PointerUnion.h b/include/llvm/ADT/PointerUnion.h index 8ea1315a736..7a4de656566 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 int is() const { return Val.getInt() == ::llvm::getPointerUnionTypeNum((T*)0);