[llvm-commits] [llvm] r67989 - /llvm/trunk/include/llvm/ADT/PointerUnion.h
Chris Lattner
sabre at nondot.org
Sat Mar 28 23:32:47 PDT 2009
Author: lattner
Date: Sun Mar 29 01:32:46 2009
New Revision: 67989
URL: http://llvm.org/viewvc/llvm-project?rev=67989&view=rev
Log:
add helper method.
Modified:
llvm/trunk/include/llvm/ADT/PointerUnion.h
Modified: llvm/trunk/include/llvm/ADT/PointerUnion.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/PointerUnion.h?rev=67989&r1=67988&r2=67989&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/PointerUnion.h (original)
+++ llvm/trunk/include/llvm/ADT/PointerUnion.h Sun Mar 29 01:32:46 2009
@@ -78,6 +78,8 @@
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);
More information about the llvm-commits
mailing list