aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDebugInfo.h
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-07-22 22:29:16 +0000
committerDevang Patel <dpatel@apple.com>2010-07-22 22:29:16 +0000
commit5a6fbcfd8c15a2296f94a0473a68ec09d429827f (patch)
treef64aab6d8de87d5c02bde0bb49bce720661a67d2 /lib/CodeGen/CGDebugInfo.h
parentdb2cfecf0eb6683be103b8550026817426da2d42 (diff)
Keep track of artificial scopes introduced by line directives. For example,
#line 41 "bar.c" dummy (1, i); #line 24 "bar.h" i = f2 (i); #line 44 "bar.c" This is tested by step-line.exp in gdb testsuite. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109189 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.h')
-rw-r--r--lib/CodeGen/CGDebugInfo.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/CodeGen/CGDebugInfo.h b/lib/CodeGen/CGDebugInfo.h
index ed18a44c08..fdfd3dca57 100644
--- a/lib/CodeGen/CGDebugInfo.h
+++ b/lib/CodeGen/CGDebugInfo.h
@@ -58,6 +58,14 @@ class CGDebugInfo {
std::vector<llvm::TrackingVH<llvm::MDNode> > RegionStack;
llvm::DenseMap<const Decl *, llvm::WeakVH> RegionMap;
+ // FnBeginRegionCount - Keep track of RegionStack counter at the beginning
+ // of a function. This is used to pop unbalanced regions at the end of a
+ // function.
+ std::vector<unsigned> FnBeginRegionCount;
+
+ /// LineDirectiveFiles - This stack is used to keep track of
+ /// scopes introduced by #line directives.
+ std::vector<const char *> LineDirectiveFiles;
/// DebugInfoNames - This is a storage for names that are
/// constructed on demand. For example, C++ destructors, C++ operators etc..
@@ -134,6 +142,13 @@ public:
void EmitFunctionStart(GlobalDecl GD, QualType FnType,
llvm::Function *Fn, CGBuilderTy &Builder);
+ /// EmitFunctionEnd - Constructs the debug code for exiting a function.
+ void EmitFunctionEnd(CGBuilderTy &Builder);
+
+ /// UpdateLineDirectiveRegion - Update region stack only if #line directive
+ /// has introduced scope change.
+ void UpdateLineDirectiveRegion(CGBuilderTy &Builder);
+
/// EmitRegionStart - Emit a call to llvm.dbg.region.start to indicate start
/// of a new block.
void EmitRegionStart(CGBuilderTy &Builder);