it clear what we want to do. Unfortunately the conversion to
pointer operator fires now instead and chasing down all of the
conversions and making them explicit and handled is a large task
so add a FIXME with it.
llvm-svn: 186543
operator MDNode *() const { return const_cast<MDNode*>(DbgNode); }
MDNode *operator ->() const { return const_cast<MDNode*>(DbgNode); }
+ // An explicit operator bool so that we can do testing of DI values
+ // easily.
+ // FIXME: This operator bool isn't actually protecting anything at the
+ // moment due to the conversion operator above making DIDescriptor nodes
+ // implicitly convertable to pointer.
+ LLVM_EXPLICIT operator bool() const { return DbgNode != 0; }
+
unsigned getTag() const {
return getUnsignedField(0) & ~LLVMDebugVersionMask;
}