Skip to content

Commit 36068ca

Browse files
author
bogon-right
committed
Remove profiler_builtins crate
1 parent e74143e commit 36068ca

File tree

18 files changed

+16
-154
lines changed

18 files changed

+16
-154
lines changed

Cargo.lock

-8
Original file line numberDiff line numberDiff line change
@@ -2736,13 +2736,6 @@ dependencies = [
27362736
"std",
27372737
]
27382738

2739-
[[package]]
2740-
name = "profiler_builtins"
2741-
version = "0.0.0"
2742-
dependencies = [
2743-
"cc",
2744-
]
2745-
27462739
[[package]]
27472740
name = "psm"
27482741
version = "0.1.16"
@@ -4682,7 +4675,6 @@ dependencies = [
46824675
"object 0.26.2",
46834676
"panic_abort",
46844677
"panic_unwind",
4685-
"profiler_builtins",
46864678
"rand 0.7.3",
46874679
"rustc-demangle",
46884680
"std_detect",

compiler/rustc_feature/src/builtin_attrs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
578578
),
579579
gated!(
580580
profiler_runtime, Normal, template!(Word), WarnFollowing,
581-
"the `#[profiler_runtime]` attribute is used to identify the `profiler_builtins` crate \
581+
"the `#[profiler_runtime]` attribute is used to identify the crate \
582582
which contains the profiler runtime and will never be stable",
583583
),
584584

compiler/rustc_metadata/src/creader.rs

+1
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,7 @@ impl<'a> CrateLoader<'a> {
764764
|| !(self.sess.instrument_coverage()
765765
|| self.sess.opts.unstable_opts.profile
766766
|| self.sess.opts.cg.profile_generate.enabled())
767+
|| self.sess.opts.unstable_opts.profiler_runtime == "profiler_builtins"
767768
{
768769
return;
769770
}

compiler/rustc_metadata/src/rmeta/decoder.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1509,7 +1509,6 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
15091509
"proc_macro",
15101510
"panic_abort",
15111511
"panic_unwind",
1512-
"profiler_builtins",
15131512
"rtstartup",
15141513
"rustc-std-workspace-core",
15151514
"rustc-std-workspace-alloc",

compiler/rustc_session/src/options.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1423,7 +1423,7 @@ options! {
14231423
no_parallel_llvm: bool = (false, parse_no_flag, [UNTRACKED],
14241424
"run LLVM in non-parallel mode (while keeping codegen-units and ThinLTO)"),
14251425
no_profiler_runtime: bool = (false, parse_no_flag, [TRACKED],
1426-
"prevent automatic injection of the profiler_builtins crate"),
1426+
"prevent automatic injection of the profiler runtime"),
14271427
no_unique_section_names: bool = (false, parse_bool, [TRACKED],
14281428
"do not use unique names for text and data sections when -Z function-sections is used"),
14291429
normalize_docs: bool = (false, parse_bool, [TRACKED],

library/profiler_builtins/Cargo.toml

-12
This file was deleted.

library/profiler_builtins/build.rs

-89
This file was deleted.

library/profiler_builtins/src/lib.rs

-8
This file was deleted.

library/std/Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ panic_abort = { path = "../panic_abort" }
1717
core = { path = "../core" }
1818
libc = { version = "0.2.126", default-features = false, features = ['rustc-dep-of-std'] }
1919
compiler_builtins = { version = "0.1.73" }
20-
profiler_builtins = { path = "../profiler_builtins", optional = true }
2120
unwind = { path = "../unwind" }
2221
hashbrown = { version = "0.12", default-features = false, features = ['rustc-dep-of-std'] }
2322
std_detect = { path = "../stdarch/crates/std_detect", default-features = false, features = ['rustc-dep-of-std'] }
@@ -57,7 +56,7 @@ backtrace = [
5756
gimli-symbolize = []
5857

5958
panic-unwind = ["panic_unwind"]
60-
profiler = ["profiler_builtins"]
59+
profiler = []
6160
compiler-builtins-c = ["alloc/compiler-builtins-c"]
6261
compiler-builtins-mem = ["alloc/compiler-builtins-mem"]
6362
compiler-builtins-no-asm = ["alloc/compiler-builtins-no-asm"]

src/bootstrap/builder.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ impl<'a> ShouldRun<'a> {
406406
/// `all_krates` should probably be removed at some point.
407407
pub fn all_krates(mut self, name: &str) -> Self {
408408
let mut set = BTreeSet::new();
409-
for krate in self.builder.in_tree_crates(name, None) {
409+
for krate in self.builder.in_tree_crates(name) {
410410
let path = krate.local_path(self.builder);
411411
set.insert(TaskPath { path, kind: Some(self.kind) });
412412
}
@@ -419,7 +419,7 @@ impl<'a> ShouldRun<'a> {
419419
///
420420
/// `make_run` will be called a single time with all matching command-line paths.
421421
pub fn crate_or_deps(self, name: &str) -> Self {
422-
let crates = self.builder.in_tree_crates(name, None);
422+
let crates = self.builder.in_tree_crates(name);
423423
self.crates(crates)
424424
}
425425

src/bootstrap/check.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ impl Step for Std {
152152
// Explicitly pass -p for all dependencies krates -- this will force cargo
153153
// to also check the tests/benches/examples for these crates, rather
154154
// than just the leaf crate.
155-
for krate in builder.in_tree_crates("test", Some(target)) {
155+
for krate in builder.in_tree_crates("test") {
156156
cargo.arg("-p").arg(krate.name);
157157
}
158158

@@ -228,7 +228,7 @@ impl Step for Rustc {
228228
// Explicitly pass -p for all compiler krates -- this will force cargo
229229
// to also check the tests/benches/examples for these crates, rather
230230
// than just the leaf crate.
231-
for krate in builder.in_tree_crates("rustc-main", Some(target)) {
231+
for krate in builder.in_tree_crates("rustc-main") {
232232
cargo.arg("-p").arg(krate.name);
233233
}
234234

src/bootstrap/compile.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,6 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car
327327

328328
builder.update_submodule(&Path::new("src").join("llvm-project"));
329329
let compiler_builtins_root = builder.src.join("src/llvm-project/compiler-rt");
330-
// Note that `libprofiler_builtins/build.rs` also computes this so if
331-
// you're changing something here please also change that.
332330
cargo.env("RUST_COMPILER_RT_ROOT", &compiler_builtins_root);
333331
" compiler-builtins-c"
334332
} else {
@@ -617,7 +615,7 @@ impl Step for Rustc {
617615
const DEFAULT: bool = false;
618616

619617
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
620-
let mut crates = run.builder.in_tree_crates("rustc-main", None);
618+
let mut crates = run.builder.in_tree_crates("rustc-main");
621619
for (i, krate) in crates.iter().enumerate() {
622620
if krate.name == "rustc-main" {
623621
crates.swap_remove(i);

src/bootstrap/doc.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -709,9 +709,9 @@ impl Step for Rustc {
709709
paths.into_iter().map(|p| builder.crate_paths[p]).collect()
710710
};
711711
// Find dependencies for top level crates.
712-
let compiler_crates = root_crates.iter().flat_map(|krate| {
713-
builder.in_tree_crates(krate, Some(target)).into_iter().map(|krate| krate.name)
714-
});
712+
let compiler_crates = root_crates
713+
.iter()
714+
.flat_map(|krate| builder.in_tree_crates(krate).into_iter().map(|krate| krate.name));
715715

716716
let mut to_open = None;
717717
for krate in compiler_crates {

src/bootstrap/lib.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -1368,7 +1368,7 @@ impl Build {
13681368
/// Returns a Vec of all the dependencies of the given root crate,
13691369
/// including transitive dependencies and the root itself. Only includes
13701370
/// "local" crates (those in the local source tree, not from a registry).
1371-
fn in_tree_crates(&self, root: &str, target: Option<TargetSelection>) -> Vec<&Crate> {
1371+
fn in_tree_crates(&self, root: &str) -> Vec<&Crate> {
13721372
let mut ret = Vec::new();
13731373
let mut list = vec![INTERNER.intern_str(root)];
13741374
let mut visited = HashSet::new();
@@ -1386,10 +1386,6 @@ impl Build {
13861386
// the future, we may want to consider just filtering all
13871387
// build and dev dependencies in metadata::build.
13881388
if visited.insert(dep)
1389-
&& (dep != "profiler_builtins"
1390-
|| target
1391-
.map(|t| self.config.profiler_enabled(t))
1392-
.unwrap_or_else(|| self.config.any_profiler_enabled()))
13931389
&& (dep != "rustc_codegen_llvm" || self.config.llvm_enabled())
13941390
{
13951391
list.push(*dep);

src/doc/unstable-book/src/library-features/profiler-runtime-lib.md

-5
This file was deleted.

src/test/rustdoc-ui/z-help.stdout

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
-Z no-leak-check=val -- disable the 'leak check' for subtyping; unsound, but useful for tests
9595
-Z no-link=val -- compile without linking
9696
-Z no-parallel-llvm=val -- run LLVM in non-parallel mode (while keeping codegen-units and ThinLTO)
97-
-Z no-profiler-runtime=val -- prevent automatic injection of the profiler_builtins crate
97+
-Z no-profiler-runtime=val -- prevent automatic injection of the profiler runtime
9898
-Z no-unique-section-names=val -- do not use unique names for text and data sections when -Z function-sections is used
9999
-Z normalize-docs=val -- normalize associated items in rustdoc when generating documentation
100100
-Z oom=val -- panic strategy for out-of-memory handling
@@ -123,7 +123,7 @@
123123
-Z profile-closures=val -- profile size of closures
124124
-Z profile-emit=val -- file path to emit profiling data at runtime when using 'profile' (default based on relative source path)
125125
-Z profile-sample-use=val -- use the given `.prof` file for sampled profile-guided optimization (also known as AutoFDO)
126-
-Z profiler-runtime=val -- name of the profiler runtime crate to automatically inject (default: `profiler_builtins`)
126+
-Z profiler-runtime=val -- name of the profiler runtime crate to automatically inject
127127
-Z query-dep-graph=val -- enable queries of the dependency graph for regression testing (default: no)
128128
-Z randomize-layout=val -- randomize the layout of types (default: no)
129129
-Z relax-elf-relocations=val -- whether ELF relocations can be relaxed

src/test/ui/feature-gates/feature-gate-profiler-runtime.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0658]: the `#[profiler_runtime]` attribute is used to identify the `profiler_builtins` crate which contains the profiler runtime and will never be stable
1+
error[E0658]: the `#[profiler_runtime]` attribute is used to identify the crate which contains the profiler runtime and will never be stable
22
--> $DIR/feature-gate-profiler-runtime.rs:1:1
33
|
44
LL | #![profiler_runtime]

src/tools/rust-analyzer/crates/ide-db/src/generated/lints.rs

-9
Original file line numberDiff line numberDiff line change
@@ -3722,15 +3722,6 @@ This feature is internal to the Rust compiler and is not intended for general us
37223722
37233723
The tracking issue for this feature is: [#42524](https://github.com/rust-lang/rust/issues/42524).
37243724
3725-
------------------------
3726-
"##,
3727-
},
3728-
Lint {
3729-
label: "profiler_runtime_lib",
3730-
description: r##"# `profiler_runtime_lib`
3731-
3732-
This feature is internal to the Rust compiler and is not intended for general use.
3733-
37343725
------------------------
37353726
"##,
37363727
},

0 commit comments

Comments
 (0)