[cfe-commits] r140738 - /cfe/trunk/lib/CodeGen/CGDebugInfo.cpp

Eric Christopher echristo at apple.com
Wed Sep 28 17:00:37 PDT 2011


Author: echristo
Date: Wed Sep 28 19:00:37 2011
New Revision: 140738

URL: http://llvm.org/viewvc/llvm-project?rev=140738&view=rev
Log:
Reorder functions in the file.

Modified:
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=140738&r1=140737&r2=140738&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Wed Sep 28 19:00:37 2011
@@ -1751,33 +1751,8 @@
   LineDirectiveFiles.clear();
 }
 
-
-void CGDebugInfo::EmitStopPoint(CGBuilderTy &Builder) {
-  if (CurLoc.isInvalid() || CurLoc.isMacroID()) return;
-
-  // Don't bother if things are the same as last time.
-  SourceManager &SM = CGM.getContext().getSourceManager();
-  if (CurLoc == PrevLoc || 
-      SM.getExpansionLoc(CurLoc) == SM.getExpansionLoc(PrevLoc))
-    // New Builder may not be in sync with CGDebugInfo.
-    if (!Builder.getCurrentDebugLocation().isUnknown())
-      return;
-
-  // The file may have had a line directive change. Process any of
-  // those before updating the state.
-  UpdateLineDirectiveRegion(Builder);
-  
-  // Update last state.
-  PrevLoc = CurLoc;
-
-  llvm::MDNode *Scope = RegionStack.back();
-  Builder.SetCurrentDebugLocation(llvm::DebugLoc::get(getLineNumber(CurLoc),
-                                                      getColumnNumber(CurLoc),
-                                                      Scope));
-}
-
-/// UpdateLineDirectiveRegion - Update region stack only if #line directive
-/// has introduced scope change.
+// UpdateLineDirectiveRegion - Update region stack only if #line directive
+// has introduced scope change.
 void CGDebugInfo::UpdateLineDirectiveRegion(CGBuilderTy &Builder) {
   if (CurLoc.isInvalid() || CurLoc.isMacroID() ||
       PrevLoc.isInvalid() || PrevLoc.isMacroID())
@@ -1798,12 +1773,12 @@
   }
 
   assert (RegionStack.size() >= LineDirectiveFiles.size()
-          && "error handling #line regions!");
+	  && "error handling #line regions!");
 
   bool SeenThisFile = false;
   // Chek if current file is already seen earlier.
   for(std::vector<const char *>::iterator I = LineDirectiveFiles.begin(),
-        E = LineDirectiveFiles.end(); I != E; ++I)
+	E = LineDirectiveFiles.end(); I != E; ++I)
     if (!strcmp(PCLoc.getFilename(), *I)) {
       SeenThisFile = true;
       break;
@@ -1816,10 +1791,10 @@
       RegionStack.pop_back();
       LineDirectiveFiles.pop_back();
       if (!strcmp(PPLoc.getFilename(), LastFile))
-        break;
+	break;
     }
     return;
-  } 
+  }
 
   // .. otherwise insert new #line region.
   EmitRegionStart(Builder);
@@ -1828,6 +1803,30 @@
   return;
 }
 
+void CGDebugInfo::EmitStopPoint(CGBuilderTy &Builder) {
+  if (CurLoc.isInvalid() || CurLoc.isMacroID()) return;
+
+  // Don't bother if things are the same as last time.
+  SourceManager &SM = CGM.getContext().getSourceManager();
+  if (CurLoc == PrevLoc || 
+      SM.getExpansionLoc(CurLoc) == SM.getExpansionLoc(PrevLoc))
+    // New Builder may not be in sync with CGDebugInfo.
+    if (!Builder.getCurrentDebugLocation().isUnknown())
+      return;
+
+  // The file may have had a line directive change. Process any of
+  // those before updating the state.
+  UpdateLineDirectiveRegion(Builder);
+  
+  // Update last state.
+  PrevLoc = CurLoc;
+
+  llvm::MDNode *Scope = RegionStack.back();
+  Builder.SetCurrentDebugLocation(llvm::DebugLoc::get(getLineNumber(CurLoc),
+                                                      getColumnNumber(CurLoc),
+                                                      Scope));
+}
+
 /// EmitRegionStart- Constructs the debug code for entering a declarative
 /// region - beginning of a DW_TAG_lexical_block.
 void CGDebugInfo::EmitRegionStart(CGBuilderTy &Builder) {





More information about the cfe-commits mailing list