summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-11-14 22:25:02 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-11-14 22:25:02 +0000
commit32887559c4281687c05a5a8f0c15d3d6f05d6798 (patch)
treef271cce1159fcea85e94f1db60a58c0db3f2336f /llvm/lib
parentd3d5c3300e71be3a66042b3a2b5e872d911e92c5 (diff)
downloadbcm5719-llvm-32887559c4281687c05a5a8f0c15d3d6f05d6798.tar.gz
bcm5719-llvm-32887559c4281687c05a5a8f0c15d3d6f05d6798.zip
DebugInfo: Simplify/narrow null-check for getOrCreateType
llvm-svn: 194737
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index 857b41415ab..44706d7647d 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -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()));
OpenPOWER on IntegriCloud