DebugInfo: Simplify/narrow null-check for getOrCreateType

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194737 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie 2013-11-14 22:25:02 +00:00
parent b850a05f2c
commit 41e1a18885

View File

@ -877,10 +877,12 @@ DIE *CompileUnit::getOrCreateContextDIE(DIScope Context) {
/// 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()));