-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #109808 - jyn514:debuginfo-options, r=michaelwoerister
Extend -Cdebuginfo with new options and named aliases This is a rebase of #83947, along with my best guess at what the new options mean. I tried to follow the LLVM source code to get a better idea but ran into quite a lot of trouble (https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/go-to-definition.20in.20src.2Fllvm-project.3F). The description for the original PR follows below. Note that the changes in this PR have already been through FCP: #83947 (comment) Closes #109311. Helps with #104968. r? `@michaelwoerister` cc `@cuviper` --- The -Cdebuginfo=1 option was never line tables only and can't be due to backwards compatibility issues. This was clarified and an option for emitting line tables only was added. Additionally an option for emitting line info directives only was added, which is needed for some targets, i.e. nvptx. The debug info options should now behave similarly to clang's debug info options. Fix #60020 Fix #64405
- Loading branch information
Showing
13 changed files
with
133 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Verify that the limited debuginfo option emits llvm's FullDebugInfo, but no type info. | ||
// | ||
// compile-flags: -C debuginfo=limited | ||
|
||
#[repr(C)] | ||
struct StructType { | ||
a: i64, | ||
b: i32, | ||
} | ||
|
||
extern "C" { | ||
fn creator() -> *mut StructType; | ||
fn save(p: *const StructType); | ||
} | ||
|
||
fn main() { | ||
unsafe { | ||
let value: &mut StructType = &mut *creator(); | ||
value.a = 7; | ||
save(value as *const StructType) | ||
} | ||
} | ||
|
||
// CHECK: !DICompileUnit | ||
// CHECK: emissionKind: FullDebug | ||
// CHECK: !DILocation | ||
// CHECK-NOT: !DIBasicType |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Verify that the only debuginfo generated are the line directives. | ||
// | ||
// compile-flags: -C debuginfo=line-directives-only | ||
|
||
#[repr(C)] | ||
struct StructType { | ||
a: i64, | ||
b: i32, | ||
} | ||
|
||
extern "C" { | ||
fn creator() -> *mut StructType; | ||
fn save(p: *const StructType); | ||
} | ||
|
||
fn main() { | ||
unsafe { | ||
let value: &mut StructType = &mut *creator(); | ||
value.a = 7; | ||
save(value as *const StructType) | ||
} | ||
} | ||
|
||
// CHECK: !DICompileUnit | ||
// CHECK: emissionKind: DebugDirectivesOnly | ||
// CHECK: !DILocation | ||
// CHECK-NOT: !DIBasicType |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Verify that the only debuginfo generated are the line tables. | ||
// | ||
// compile-flags: -C debuginfo=line-tables-only | ||
|
||
#[repr(C)] | ||
struct StructType { | ||
a: i64, | ||
b: i32, | ||
} | ||
|
||
extern "C" { | ||
fn creator() -> *mut StructType; | ||
fn save(p: *const StructType); | ||
} | ||
|
||
fn main() { | ||
unsafe { | ||
let value: &mut StructType = &mut *creator(); | ||
value.a = 7; | ||
save(value as *const StructType) | ||
} | ||
} | ||
|
||
// CHECK: !DICompileUnit | ||
// CHECK: emissionKind: LineTablesOnly | ||
// CHECK: !DILocation | ||
// CHECK-NOT: !DIBasicType |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters