aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2011-09-29 00:00:37 +0000
committerEric Christopher <echristo@apple.com>2011-09-29 00:00:37 +0000
commit69a1b749ed44d59a86a9b10f21259b3a222ba068 (patch)
tree9d6e3af3fde8be42c51d4a146a4bf085a22904bd /lib/CodeGen/CGDebugInfo.cpp
parent414ee4bb74957b4c5fe05e11848028e4701b51f7 (diff)
Reorder functions in the file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140738 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp61
1 files changed, 30 insertions, 31 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index 2edb065dd6..b8a5d0d83c 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -1751,33 +1751,8 @@ void CGDebugInfo::EmitFunctionStart(GlobalDecl GD, QualType FnType,
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 @@ void CGDebugInfo::UpdateLineDirectiveRegion(CGBuilderTy &Builder) {
}
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 @@ void CGDebugInfo::UpdateLineDirectiveRegion(CGBuilderTy &Builder) {
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 @@ void CGDebugInfo::UpdateLineDirectiveRegion(CGBuilderTy &Builder) {
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) {