Skip to content

Commit a2cf62c

Browse files
committed
renamded to hotpatch
1 parent e7d7c62 commit a2cf62c

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

compiler/rustc_codegen_llvm/src/attributes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ pub fn from_fn_attrs<'ll, 'tcx>(
342342
}
343343

344344
// patchable-function is only implemented on x86 on LLVM
345-
if cx.sess().opts.unstable_opts.ms_hotpatch && cx.sess().target.is_x86() {
345+
if cx.sess().opts.unstable_opts.hotpatch && cx.sess().target.is_x86() {
346346
to_add.push(llvm::CreateAttrStringValue(
347347
cx.llcx,
348348
"patchable-function",

compiler/rustc_codegen_llvm/src/back/write.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ pub fn target_machine_factory(
222222

223223
// this annotes in the debug file that code is hotpatchable. In addtion without it -functionpadmin will be ignored.
224224
// See: https://github.com/llvm/llvm-project/blob/d703b922961e0d02a5effdd4bfbb23ad50a3cc9f/lld/COFF/Writer.cpp#L1298
225-
let use_hotpatch = sess.opts.unstable_opts.ms_hotpatch && sess.target.is_x86();
225+
let use_hotpatch = sess.opts.unstable_opts.hotpatch && sess.target.is_x86();
226226

227227
let path_mapping = sess.source_map().path_mapping().clone();
228228

compiler/rustc_interface/src/tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,7 @@ fn test_unstable_options_tracking_hash() {
778778
tracked!(fuel, Some(("abc".to_string(), 99)));
779779
tracked!(function_return, FunctionReturn::ThunkExtern);
780780
tracked!(function_sections, Some(false));
781+
tracked!(hotpatch, true);
781782
tracked!(human_readable_cgu_names, true);
782783
tracked!(incremental_ignore_spans, true);
783784
tracked!(inline_in_all_cgus, Some(true));
@@ -798,7 +799,6 @@ fn test_unstable_options_tracking_hash() {
798799
tracked!(mir_keep_place_mention, true);
799800
tracked!(mir_opt_level, Some(4));
800801
tracked!(move_size_limit, Some(4096));
801-
tracked!(ms_hotpatch, true);
802802
tracked!(mutable_noalias, false);
803803
tracked!(
804804
next_solver,

compiler/rustc_session/src/options.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1718,6 +1718,10 @@ options! {
17181718
"explicitly enable the `cfg(target_thread_local)` directive"),
17191719
hir_stats: bool = (false, parse_bool, [UNTRACKED],
17201720
"print some statistics about AST and HIR (default: no)"),
1721+
hotpatch: bool = (false, parse_bool, [TRACKED],
1722+
"ensures hotpatching is always possible by ensuring that the first instruction of \
1723+
each function is at least two bytes, and no jump within the function goes to the first instruction. \
1724+
Should be combined with link-arg passing -functionpadmin to the linker. Currently only supported for x86 (default: false)"),
17211725
human_readable_cgu_names: bool = (false, parse_bool, [TRACKED],
17221726
"generate human-readable, predictable names for codegen units (default: no)"),
17231727
identify_regions: bool = (false, parse_bool, [UNTRACKED],
@@ -1813,10 +1817,6 @@ options! {
18131817
"MIR optimization level (0-4; default: 1 in non optimized builds and 2 in optimized builds)"),
18141818
move_size_limit: Option<usize> = (None, parse_opt_number, [TRACKED],
18151819
"the size at which the `large_assignments` lint starts to be emitted"),
1816-
ms_hotpatch: bool = (false, parse_bool, [TRACKED],
1817-
"ensures hotpatching is always possible by ensuring that the first instruction of \
1818-
each function is at least two bytes, and no jump within the function goes to the first instruction. \
1819-
Should be combined with link-arg passing -functionpadmin to the linker. Currently only supported for x86 (default: false)"),
18201820
mutable_noalias: bool = (true, parse_bool, [TRACKED],
18211821
"emit noalias metadata for mutable references (default: yes)"),
18221822
next_solver: Option<NextSolverConfig> = (None, parse_next_solver_config, [TRACKED],

tests/codegen/ms-hotpatch.rs renamed to tests/codegen/hotpatch.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@ revisions: x32 x64
22
//@[x32] only-x86
33
//@[x64] only-x86_64
4-
//@ compile-flags: -Z ms-hotpatch
4+
//@ compile-flags: -Z hotpatch
55

66
#![crate_type = "lib"]
77

0 commit comments

Comments
 (0)