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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156160 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGen/debug-info-gline-tables-only2.c b/test/CodeGen/debug-info-gline-tables-only2.c
new file mode 100644
index 0000000..8e9cc64
--- /dev/null
+++ b/test/CodeGen/debug-info-gline-tables-only2.c
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 %s -gline-tables-only -S -emit-llvm -o - | FileCheck %s
+// Checks that clang with "-gline-tables-only" emits metadata for
+// compile unit, subprogram and file.
+
+int main() {
+  // CHECK: ret i32 0, !dbg
+  return 0;
+}
+
+// CHECK: !llvm.dbg.cu = !{!0}
+// CHECK: DW_TAG_compile_unit
+// CHECK: {{.*main.* DW_TAG_subprogram}}
+// CHECK: DW_TAG_file_type