Skip to content

Commit ecdf9e4

Browse files
committed
make this an unstable flag instead
1 parent 61fceb6 commit ecdf9e4

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,8 @@ pub fn file_metadata<'ll>(cx: &CodegenCx<'ll, '_>, source_file: &SourceFile) ->
639639
};
640640
let hash_value = hex_encode(source_file.src_hash.hash_bytes());
641641

642-
let source = cx.sess().opts.cg.embed_source.then_some(()).and(source_file.src.as_ref());
642+
let source =
643+
cx.sess().opts.unstable_opts.embed_source.then_some(()).and(source_file.src.as_ref());
643644

644645
unsafe {
645646
llvm::LLVMRustDIBuilderCreateFile(

compiler/rustc_session/src/options.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1489,8 +1489,6 @@ options! {
14891489
"import library generation tool (ignored except when targeting windows-gnu)"),
14901490
embed_bitcode: bool = (true, parse_bool, [TRACKED],
14911491
"emit bitcode in rlibs (default: yes)"),
1492-
embed_source: bool = (false, parse_bool, [TRACKED],
1493-
"embed source text in DWARF debug sections (default: no)"),
14941492
extra_filename: String = (String::new(), parse_string, [UNTRACKED],
14951493
"extra data to put in each output filename"),
14961494
force_frame_pointers: FramePointer = (FramePointer::MayOmit, parse_frame_pointer, [TRACKED],
@@ -1682,6 +1680,8 @@ options! {
16821680
them only if an error has not been emitted"),
16831681
ehcont_guard: bool = (false, parse_bool, [TRACKED],
16841682
"generate Windows EHCont Guard tables"),
1683+
embed_source: bool = (false, parse_bool, [TRACKED],
1684+
"embed source text in DWARF debug sections (default: no)"),
16851685
emit_stack_sizes: bool = (false, parse_bool, [UNTRACKED],
16861686
"emit a section containing stack size metadata (default: no)"),
16871687
emit_thin_lto: bool = (true, parse_bool, [TRACKED],

compiler/rustc_session/src/session.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1304,7 +1304,7 @@ fn validate_commandline_args_with_session_available(sess: &Session) {
13041304

13051305
let dwarf_version =
13061306
sess.opts.unstable_opts.dwarf_version.unwrap_or(sess.target.default_dwarf_version);
1307-
if sess.opts.cg.embed_source && dwarf_version < 5 {
1307+
if sess.opts.unstable_opts.embed_source && dwarf_version < 5 {
13081308
sess.dcx().emit_err(errors::EmbedSourceInsufficientDwarfVersion { dwarf_version });
13091309
}
13101310

src/doc/rustc/src/codegen-options/index.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -146,17 +146,6 @@ at start-up, because the combination is invalid.
146146
> reason for that is that it's how it was for rustc 1.44 and prior. In 1.45 this
147147
> option was added to turn off what had always been the default.
148148
149-
## embed-source
150-
151-
This flag controls whether the compiler embeds the program source code text into
152-
object debug info section. It takes one of the following values:
153-
154-
* `y`, `yes`, `on` or `true`: put source code in debug info.
155-
* `n`, `no`, `off`, `false` or no value: omit source code from debug info (the default).
156-
157-
`-C embed-source` requires DWARFv5. Use `-Zdwarf-version` to control the
158-
compiler's DWARF target version.
159-
160149
## extra-filename
161150

162151
This option allows you to put extra data in each output filename. It takes a
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# `embed-source`
2+
3+
This flag controls whether the compiler embeds the program source code text into
4+
object debug info section. It takes one of the following values:
5+
6+
* `y`, `yes`, `on` or `true`: put source code in debug info.
7+
* `n`, `no`, `off`, `false` or no value: omit source code from debug info (the default).
8+
9+
`-C embed-source` requires DWARFv5 and is only supported with the LLVM backend.
10+
Use `-Z dwarf-version=5` to control the compiler's DWARF target version.

0 commit comments

Comments
 (0)