git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194737
91177308-0d34-0410-b5e6-
96231b3b80d8
/// getOrCreateTypeDIE - Find existing DIE or create new DIE for the
/// given DIType.
DIE *CompileUnit::getOrCreateTypeDIE(const MDNode *TyNode) {
- DIType Ty(TyNode);
- if (!Ty.isType())
+ if (!TyNode)
return NULL;
+ DIType Ty(TyNode);
+ assert(Ty.isType());
+
// Construct the context before querying for the existence of the DIE in case
// such construction creates the DIE.
DIE *ContextDIE = getOrCreateContextDIE(resolve(Ty.getContext()));