[llvm-commits] [llvm] r65193 - /llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/DwarfWriter.cpp

Bill Wendling isanbard at gmail.com
Fri Feb 20 14:35:26 PST 2009


Author: void
Date: Fri Feb 20 16:35:26 2009
New Revision: 65193

URL: http://llvm.org/viewvc/llvm-project?rev=65193&view=rev
Log:
Pull r65149 into Dib:

- Early exit a nested block.
- Correct comment.
- Whitespace changes.

Modified:
    llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/DwarfWriter.cpp

Modified: llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=65193&r1=65192&r2=65193&view=diff

==============================================================================
--- llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original)
+++ llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Fri Feb 20 16:35:26 2009
@@ -1267,6 +1267,7 @@
   /// MainCU - Some platform prefers one compile unit per .o file. In such
   /// cases, all dies are inserted in MainCU.
   CompileUnit *MainCU;
+
   /// AbbreviationsSet - Used to uniquely define abbreviations.
   ///
   FoldingSet<DIEAbbrev> AbbreviationsSet;
@@ -1278,7 +1279,7 @@
   /// Directories - Uniquing vector for directories.
   UniqueVector<std::string> Directories;
 
-  /// SourceFiles - Uniquing vector for source files.
+  /// SrcFiles - Uniquing vector for source files.
   UniqueVector<SrcFileInfo> SrcFiles;
 
   /// Lines - List of of source line correspondence.
@@ -1990,28 +1991,32 @@
   ///
   DbgScope *getOrCreateScope(GlobalVariable *V) {
     DbgScope *&Slot = DbgScopeMap[V];
-    if (!Slot) {
-      // FIXME - breaks down when the context is an inlined function.
-      DIDescriptor ParentDesc;
-      DIDescriptor Desc(V);
-      if (Desc.getTag() == dwarf::DW_TAG_lexical_block) {
-        DIBlock Block(V);
-        ParentDesc = Block.getContext();
-      }
-      DbgScope *Parent = ParentDesc.isNull() ? 
-        NULL : getOrCreateScope(ParentDesc.getGV());
-      Slot = new DbgScope(Parent, Desc);
-      if (Parent) {
-        Parent->AddScope(Slot);
-      } else if (RootDbgScope) {
-        // FIXME - Add inlined function scopes to the root so we can delete
-        // them later.  Long term, handle inlined functions properly.
-        RootDbgScope->AddScope(Slot);
-      } else {
-        // First function is top level function.
-        RootDbgScope = Slot;
-      }
+    if (Slot) return Slot;
+
+    // FIXME - breaks down when the context is an inlined function.
+    DIDescriptor ParentDesc;
+    DIDescriptor Desc(V);
+
+    if (Desc.getTag() == dwarf::DW_TAG_lexical_block) {
+      DIBlock Block(V);
+      ParentDesc = Block.getContext();
+    }
+
+    DbgScope *Parent = ParentDesc.isNull() ? 
+      NULL : getOrCreateScope(ParentDesc.getGV());
+    Slot = new DbgScope(Parent, Desc);
+
+    if (Parent) {
+      Parent->AddScope(Slot);
+    } else if (RootDbgScope) {
+      // FIXME - Add inlined function scopes to the root so we can delete them
+      // later.  Long term, handle inlined functions properly.
+      RootDbgScope->AddScope(Slot);
+    } else {
+      // First function is top level function.
+      RootDbgScope = Slot;
     }
+
     return Slot;
   }
 
@@ -3084,7 +3089,6 @@
 
   /// ValidDebugInfo - Return true if V represents valid debug info value.
   bool ValidDebugInfo(Value *V) {
-
     if (!V)
       return false;
 





More information about the llvm-commits mailing list