diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-10-22 19:34:33 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-10-22 19:34:33 +0000 |
commit | 60a877b5b9c27fb2c3418274d05d7b0063838948 (patch) | |
tree | 2ac4181347f52ce6447b3e5733d45b6da2acbe36 /clang/lib/CodeGen/CGDebugInfo.cpp | |
parent | 6d87ce8bd59a2b2e96fa418c4f5605cb8deda809 (diff) | |
download | bcm5719-llvm-60a877b5b9c27fb2c3418274d05d7b0063838948.tar.gz bcm5719-llvm-60a877b5b9c27fb2c3418274d05d7b0063838948.zip |
DebugInfo: Omit scopes in -gmlt to reduce metadata size (on disk and in memory)
I haven't done any actual impact analysis of this change as it's a
strict improvement, but I'd be curious to know how much it helps.
llvm-svn: 220408
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 489a2032726..0d662372a11 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -2606,13 +2606,16 @@ void CGDebugInfo::EmitLexicalBlockStart(CGBuilderTy &Builder, // Set our current location. setLocation(Loc); - // Create a new lexical block and push it on the stack. - CreateLexicalBlock(Loc); - // Emit a line table change for the current location inside the new scope. Builder.SetCurrentDebugLocation(llvm::DebugLoc::get(getLineNumber(Loc), getColumnNumber(Loc), LexicalBlockStack.back())); + + if (DebugKind <= CodeGenOptions::DebugLineTablesOnly) + return; + + // Create a new lexical block and push it on the stack. + CreateLexicalBlock(Loc); } /// EmitLexicalBlockEnd - Constructs the debug code for exiting a declarative @@ -2624,6 +2627,9 @@ void CGDebugInfo::EmitLexicalBlockEnd(CGBuilderTy &Builder, // Provide an entry in the line table for the end of the block. EmitLocation(Builder, Loc); + if (DebugKind <= CodeGenOptions::DebugLineTablesOnly) + return; + LexicalBlockStack.pop_back(); } @@ -2634,8 +2640,11 @@ void CGDebugInfo::EmitFunctionEnd(CGBuilderTy &Builder) { assert(RCount <= LexicalBlockStack.size() && "Region stack mismatch"); // Pop all regions for this function. - while (LexicalBlockStack.size() != RCount) - EmitLexicalBlockEnd(Builder, CurLoc); + while (LexicalBlockStack.size() != RCount) { + // Provide an entry in the line table for the end of the block. + EmitLocation(Builder, CurLoc); + LexicalBlockStack.pop_back(); + } FnBeginRegionCount.pop_back(); } |