[llvm] r185508 - Introduce some typedefs for DenseMaps containing SmallVectors so the vector size doesn't have to repeated when creating iterators for the DenseMap.

Craig Topper craig.topper at gmail.com
Tue Jul 2 21:40:27 PDT 2013


Author: ctopper
Date: Tue Jul  2 23:40:27 2013
New Revision: 185508

URL: http://llvm.org/viewvc/llvm-project?rev=185508&view=rev
Log:
Introduce some typedefs for DenseMaps containing SmallVectors so the vector size doesn't have to repeated when creating iterators for the DenseMap.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=185508&r1=185507&r2=185508&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue Jul  2 23:40:27 2013
@@ -547,8 +547,7 @@ DIE *DwarfDebug::constructInlinedScopeDI
   // corresponding the .debug_inlined section entry for this pair.
   if (Asm->MAI->doesDwarfUseInlineInfoSection()) {
     MCSymbol *StartLabel = getLabelBeforeInsn(Ranges.begin()->first);
-    DenseMap<const MDNode *, SmallVector<InlineInfoLabels, 4> >::iterator I =
-        InlineInfo.find(InlinedSP);
+    InlineInfoMap::iterator I = InlineInfo.find(InlinedSP);
 
     if (I == InlineInfo.end()) {
       InlineInfo[InlinedSP].push_back(std::make_pair(StartLabel, ScopeDIE));
@@ -1727,7 +1726,7 @@ void DwarfDebug::endFunction(const Machi
     TheCU->addFlag(CurFnDIE, dwarf::DW_AT_APPLE_omit_frame_ptr);
 
   // Clear debug info
-  for (DenseMap<LexicalScope *, SmallVector<DbgVariable *, 8> >::iterator
+  for (ScopeVariablesMap::iterator
          I = ScopeVariables.begin(), E = ScopeVariables.end(); I != E; ++I)
     DeleteContainerPointers(I->second);
   ScopeVariables.clear();
@@ -2586,8 +2585,7 @@ void DwarfDebug::emitDebugInlineInfo() {
          E = InlinedSPNodes.end(); I != E; ++I) {
 
     const MDNode *Node = *I;
-    DenseMap<const MDNode *, SmallVector<InlineInfoLabels, 4> >::iterator II
-      = InlineInfo.find(Node);
+    InlineInfoMap::iterator II = InlineInfo.find(Node);
     SmallVectorImpl<InlineInfoLabels> &Labels = II->second;
     DISubprogram SP(Node);
     StringRef LName = SP.getLinkageName();

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=185508&r1=185507&r2=185508&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h Tue Jul  2 23:40:27 2013
@@ -327,7 +327,9 @@ class DwarfDebug {
   DenseMap<const MDNode *, DIE *> AbstractSPDies;
 
   // Collection of dbg variables of a scope.
-  DenseMap<LexicalScope *, SmallVector<DbgVariable *, 8> > ScopeVariables;
+  typedef DenseMap<LexicalScope *,
+                   SmallVector<DbgVariable *, 8> > ScopeVariablesMap;
+  ScopeVariablesMap ScopeVariables;
 
   // Collection of abstract variables.
   DenseMap<const MDNode *, DbgVariable *> AbstractVariables;
@@ -342,7 +344,9 @@ class DwarfDebug {
   // Keep track of inlined functions and their location.  This
   // information is used to populate the debug_inlined section.
   typedef std::pair<const MCSymbol *, DIE *> InlineInfoLabels;
-  DenseMap<const MDNode *, SmallVector<InlineInfoLabels, 4> > InlineInfo;
+  typedef DenseMap<const MDNode *,
+                   SmallVector<InlineInfoLabels, 4> > InlineInfoMap;
+  InlineInfoMap InlineInfo;
   SmallVector<const MDNode *, 4> InlinedSPNodes;
 
   // This is a collection of subprogram MDNodes that are processed to





More information about the llvm-commits mailing list