diff --git a/src/doc/unstable-book/src/language-features/profiler-runtime.md b/src/doc/unstable-book/src/language-features/profiler-runtime.md index aee86f63952a5..8e401566c35be 100644 --- a/src/doc/unstable-book/src/language-features/profiler-runtime.md +++ b/src/doc/unstable-book/src/language-features/profiler-runtime.md @@ -1,5 +1,5 @@ # `profiler_runtime` -The tracking issue for this feature is: [#42524](https://github.com/rust-lang/rust/issues/42524). +This feature is internal to the Rust compiler and is not intended for general use. ------------------------ diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs index df2de17f1e471..074a9680dde7b 100644 --- a/src/librustc/session/config.rs +++ b/src/librustc/session/config.rs @@ -908,6 +908,8 @@ options! {CodegenOptions, CodegenSetter, basic_codegen_options, "set the inlining threshold for"), panic: Option = (None, parse_panic_strategy, [TRACKED], "panic strategy to compile crate with"), + profile: bool = (false, parse_bool, [TRACKED], + "insert gcov profiling code"), } options! {DebuggingOptions, DebuggingSetter, basic_debugging_options, @@ -1065,8 +1067,6 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options, "a single extra argument to prepend the linker invocation (can be used several times)"), pre_link_args: Option> = (None, parse_opt_list, [UNTRACKED], "extra arguments to prepend to the linker invocation (space separated)"), - profile: bool = (false, parse_bool, [TRACKED], - "insert profiling code"), relro_level: Option = (None, parse_relro_level, [TRACKED], "choose which RELRO level to use"), nll: bool = (false, parse_bool, [UNTRACKED], diff --git a/src/librustc_metadata/creader.rs b/src/librustc_metadata/creader.rs index dc6c260ec7174..da42c216927d6 100644 --- a/src/librustc_metadata/creader.rs +++ b/src/librustc_metadata/creader.rs @@ -843,7 +843,7 @@ impl<'a> CrateLoader<'a> { } fn inject_profiler_runtime(&mut self) { - if self.sess.opts.debugging_opts.profile { + if self.sess.opts.cg.profile { info!("loading profiler"); let symbol = Symbol::intern("profiler_builtins"); diff --git a/src/librustc_trans/back/write.rs b/src/librustc_trans/back/write.rs index 68140011e7ec3..2d14eac71eeb1 100644 --- a/src/librustc_trans/back/write.rs +++ b/src/librustc_trans/back/write.rs @@ -707,7 +707,7 @@ pub fn start_async_translation(sess: &Session, } } - if sess.opts.debugging_opts.profile { + if sess.opts.cg.profile { modules_config.passes.push("insert-gcov-profiling".to_owned()) } diff --git a/src/librustc_trans/debuginfo/metadata.rs b/src/librustc_trans/debuginfo/metadata.rs index 3c87bc293b5b5..ef4a93677e322 100644 --- a/src/librustc_trans/debuginfo/metadata.rs +++ b/src/librustc_trans/debuginfo/metadata.rs @@ -816,7 +816,7 @@ pub fn compile_unit_metadata(scc: &SharedCrateContext, 0, split_name.as_ptr() as *const _); - if sess.opts.debugging_opts.profile { + if sess.opts.cg.profile { let cu_desc_metadata = llvm::LLVMRustMetadataAsValue(debug_context.llcontext, unit_metadata); diff --git a/src/test/run-make/profile/Makefile b/src/test/run-make/profile/Makefile index 7300bfc955363..12c8f89ad58d0 100644 --- a/src/test/run-make/profile/Makefile +++ b/src/test/run-make/profile/Makefile @@ -2,7 +2,7 @@ all: ifeq ($(PROFILER_SUPPORT),1) - $(RUSTC) -g -Z profile test.rs + $(RUSTC) -g -C profile test.rs $(call RUN,test) || exit 1 [ -e "$(TMPDIR)/test.gcno" ] || (echo "No .gcno file"; exit 1) [ -e "$(TMPDIR)/test.gcda" ] || (echo "No .gcda file"; exit 1)