add helper method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67989 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2009-03-29 06:32:46 +00:00
parent 2491e4657d
commit ba315c1ee7

View 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);