diff options
| author | Devang Patel <dpatel@apple.com> | 2010-07-22 22:29:16 +0000 |
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2010-07-22 22:29:16 +0000 |
| commit | 0884a60eb5b26a9a9fd716e408cf6dcd8b4d1d7d (patch) | |
| tree | 15b2dcaa83124ae80b3ca56d2eea6542a0d37a39 /clang/lib/CodeGen/CGDebugInfo.h | |
| parent | c2f81007c01b2c791c656f5d8c69f1d585b1b6df (diff) | |
| download | bcm5719-llvm-0884a60eb5b26a9a9fd716e408cf6dcd8b4d1d7d.tar.gz bcm5719-llvm-0884a60eb5b26a9a9fd716e408cf6dcd8b4d1d7d.zip | |
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.
llvm-svn: 109189
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.h')
| -rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h index ed18a44c088..fdfd3dca571 100644 --- a/clang/lib/CodeGen/CGDebugInfo.h +++ b/clang/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); |

