Skip to content

Commit 254ed22

Browse files
committed
Rename the asm-comments to verbose-asm
Since this codegen flag now only controls LLVM-generated comments rather than all assembly comments, make the name more accurate (and also match Clang).
1 parent c260d3e commit 254ed22

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

compiler/rustc_codegen_llvm/src/back/owned_target_machine.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl OwnedTargetMachine {
3232
unique_section_names: bool,
3333
trap_unreachable: bool,
3434
singletree: bool,
35-
asm_comments: bool,
35+
verbose_asm: bool,
3636
emit_stack_size_section: bool,
3737
relax_elf_relocations: bool,
3838
use_init_array: bool,
@@ -64,7 +64,7 @@ impl OwnedTargetMachine {
6464
unique_section_names,
6565
trap_unreachable,
6666
singletree,
67-
asm_comments,
67+
verbose_asm,
6868
emit_stack_size_section,
6969
relax_elf_relocations,
7070
use_init_array,

compiler/rustc_codegen_llvm/src/back/write.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ pub fn target_machine_factory(
214214
sess.opts.unstable_opts.trap_unreachable.unwrap_or(sess.target.trap_unreachable);
215215
let emit_stack_size_section = sess.opts.unstable_opts.emit_stack_sizes;
216216

217-
let asm_comments = sess.opts.unstable_opts.asm_comments;
217+
let verbose_asm = sess.opts.unstable_opts.verbose_asm;
218218
let relax_elf_relocations =
219219
sess.opts.unstable_opts.relax_elf_relocations.unwrap_or(sess.target.relax_elf_relocations);
220220

@@ -289,7 +289,7 @@ pub fn target_machine_factory(
289289
funique_section_names,
290290
trap_unreachable,
291291
singlethread,
292-
asm_comments,
292+
verbose_asm,
293293
emit_stack_size_section,
294294
relax_elf_relocations,
295295
use_init_array,

compiler/rustc_codegen_llvm/src/llvm/ffi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2185,7 +2185,7 @@ extern "C" {
21852185
UniqueSectionNames: bool,
21862186
TrapUnreachable: bool,
21872187
Singlethread: bool,
2188-
AsmComments: bool,
2188+
VerboseAsm: bool,
21892189
EmitStackSizeSection: bool,
21902190
RelaxELFRelocations: bool,
21912191
UseInitArray: bool,

compiler/rustc_interface/src/tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,6 @@ fn test_unstable_options_tracking_hash() {
757757
// tidy-alphabetical-start
758758
tracked!(allow_features, Some(vec![String::from("lang_items")]));
759759
tracked!(always_encode_mir, true);
760-
tracked!(asm_comments, true);
761760
tracked!(assume_incomplete_release, true);
762761
tracked!(binary_dep_depinfo, true);
763762
tracked!(box_noalias, false);
@@ -862,6 +861,7 @@ fn test_unstable_options_tracking_hash() {
862861
tracked!(uninit_const_chunk_threshold, 123);
863862
tracked!(unleash_the_miri_inside_of_you, true);
864863
tracked!(use_ctors_section, Some(true));
864+
tracked!(verbose_asm, true);
865865
tracked!(verify_llvm_ir, true);
866866
tracked!(virtual_function_elimination, true);
867867
tracked!(wasi_exec_model, Some(WasiExecModel::Reactor));

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
435435
Options.DataSections = DataSections;
436436
Options.FunctionSections = FunctionSections;
437437
Options.UniqueSectionNames = UniqueSectionNames;
438-
Options.MCOptions.AsmVerbose = AsmComments;
438+
Options.MCOptions.AsmVerbose = VerboseAsm;
439439
// Always preserve comments that were written by the user
440440
Options.MCOptions.PreserveAsmComments = true;
441441
Options.MCOptions.ABIName = ABIStr;

compiler/rustc_session/src/options.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1630,8 +1630,6 @@ options! {
16301630
"only allow the listed language features to be enabled in code (comma separated)"),
16311631
always_encode_mir: bool = (false, parse_bool, [TRACKED],
16321632
"encode MIR of all functions into the crate metadata (default: no)"),
1633-
asm_comments: bool = (false, parse_bool, [TRACKED],
1634-
"generate comments into the assembly (may change behavior) (default: no)"),
16351633
assert_incr_state: Option<String> = (None, parse_opt_string, [UNTRACKED],
16361634
"assert that the incremental cache is in given state: \
16371635
either `loaded` or `not-loaded`."),
@@ -2107,6 +2105,8 @@ written to standard error output)"),
21072105
"Generate sync unwind tables instead of async unwind tables (default: no)"),
21082106
validate_mir: bool = (false, parse_bool, [UNTRACKED],
21092107
"validate MIR after each transformation"),
2108+
verbose_asm: bool = (false, parse_bool, [TRACKED],
2109+
"add descriptive comments from LLVM to the assembly (may change behavior) (default: no)"),
21102110
#[rustc_lint_opt_deny_field_access("use `Session::verbose_internals` instead of this field")]
21112111
verbose_internals: bool = (false, parse_bool, [TRACKED_NO_CRATE_HASH],
21122112
"in general, enable more debug printouts (default: no)"),

0 commit comments

Comments
 (0)