mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Add rudimentry debug info metadata emission (#4225)
This adds just the debug info metadata for Compilation Units (the top level container of debug info) - but without anything in them, LLVM won't emit them at all, so while this is testable at the IR level, it isn't observable at the object level until more debug info is added. A couple of starting points in this patch: * A flag (`--debug-info`, seems to match the naming/style of other flags in the carbon driver, though this is different from the naming conventions of clang/gcc) that enables debug info when lowering. Open to other names/approaches (on by default? historically debug info's been to large/expensive to do this, so sticking with that precedent for now). * Enabling that flag by default in the lowering tests - I do find the churn on golden tests a bit rough, and adding more features to all the tests means more churn, but it seems consistent with the approach so far - keep an eye on this and perhaps revisit this if the churn gets too annoying --------- Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com> Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
This commit is contained in:
co-authored by
Carbon Infra Bot
Jon Ross-Perkins
parent
b6396e97f8
commit
d57aa57215
@@ -32,3 +32,11 @@ fn F(p: i32**) -> i32 {
|
||||
// CHECK:STDOUT: %.loc15_10.2 = load i32, ptr %.loc15_11.2, align 4
|
||||
// CHECK:STDOUT: ret i32 %.loc15_10.2
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !llvm.module.flags = !{!0, !1}
|
||||
// CHECK:STDOUT: !llvm.dbg.cu = !{!2}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5}
|
||||
// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
|
||||
// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !3 = !DIFile(filename: "pointer_to_pointer.carbon", directory: "")
|
||||
|
||||
Reference in New Issue
Block a user