summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2012-05-04 07:39:27 +0000
committerAlexey Samsonov <samsonov@google.com>2012-05-04 07:39:27 +0000
commit74a3868dbba7f8b82fd2985a009713b239d237a9 (patch)
treea7fed5d515bab70dd166e15d5488142c1be2b18f /clang/lib/CodeGen/CodeGenFunction.cpp
parentbdd2e34b1fcb1e69abeb075b18335a9dcefaf015 (diff)
downloadbcm5719-llvm-74a3868dbba7f8b82fd2985a009713b239d237a9.tar.gz
bcm5719-llvm-74a3868dbba7f8b82fd2985a009713b239d237a9.zip
This patch adds a new Clang compiler flag "-gline-tables-only".
It reduces the amount of emitted debug information: 1) DIEs in .debug_info have types DW_TAG_compile_unit, DW_TAG_subprogram, DW_TAG_inlined_subroutine (for opt builds) and DW_TAG_lexical_block only. 2) .debug_str contains only function names. 3) No debug data for types/namespaces/variables is emitted. 4) The data in .debug_line is enough to produce valid stack traces with function names and line numbers. Reviewed by Eric Christopher. llvm-svn: 156160
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index fd787394d78..dfb04b42aa5 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -1087,7 +1087,8 @@ void CodeGenFunction::EmitDeclRefExprDbgValue(const DeclRefExpr *E,
llvm::Constant *Init) {
assert (Init && "Invalid DeclRefExpr initializer!");
if (CGDebugInfo *Dbg = getDebugInfo())
- Dbg->EmitGlobalVariable(E->getDecl(), Init);
+ if (CGM.getCodeGenOpts().DebugInfo >= CodeGenOptions::LimitedDebugInfo)
+ Dbg->EmitGlobalVariable(E->getDecl(), Init);
}
CodeGenFunction::PeepholeProtection
OpenPOWER on IntegriCloud