Avoid unnecessary map lookup/insertion.
authorDavid Blaikie <dblaikie@gmail.com>
Fri, 10 Oct 2014 03:09:38 +0000 (03:09 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Fri, 10 Oct 2014 03:09:38 +0000 (03:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219466 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfDebug.cpp

index 62c82a397ecfbeb18f4117abd1ed2cf7163dc75f..b461674ad6381c92548d63947fe8339554570665 100644 (file)
@@ -337,12 +337,12 @@ void DwarfDebug::constructAbstractSubprogramScopeDIE(LexicalScope *Scope) {
 
   DISubprogram SP(Scope->getScopeNode());
 
-  ProcessedSPNodes.insert(SP);
-
   DIE *&AbsDef = AbstractSPDies[SP];
   if (AbsDef)
     return;
 
+  ProcessedSPNodes.insert(SP);
+
   // Find the subprogram's DwarfCompileUnit in the SPMap in case the subprogram
   // was inlined from another compile unit.
   DwarfCompileUnit &SPCU = *SPMap[SP];