Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 5b159f5

Browse files
borsmati865
authored andcommittedNov 12, 2024
Auto merge of rust-lang#132756 - workingjubilee:rollup-bed2akn, r=workingjubilee
Rollup of 10 pull requests Successful merges: - rust-lang#130586 (Set "symbol name" in raw-dylib import libraries to the decorated name) - rust-lang#131913 (Add `{ignore,needs}-{rustc,std}-debug-assertions` directive support) - rust-lang#132095 (Fix rust-lang#131977 parens mangled in shared mut static lint suggestion) - rust-lang#132131 ([StableMIR] API to retrieve definitions from crates) - rust-lang#132639 (core: move intrinsics.rs into intrinsics folder) - rust-lang#132696 (Compile `test_num_f128` conditionally on `reliable_f128_math` config) - rust-lang#132737 (bootstrap: Print better message if lock pid isn't available) - rust-lang#132739 (Fix `librustdoc/scrape_examples.rs` formatting) - rust-lang#132740 (Update test for LLVM 20's new vector splat syntax) - rust-lang#132741 (Update mips64 data layout to match LLVM 20 change) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 614bd73 + 19c5325 commit 5b159f5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+569
-141
lines changed
 

‎compiler/rustc_session/src/cstore.rs

+5
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ impl DllImport {
130130
None
131131
}
132132
}
133+
134+
pub fn is_missing_decorations(&self) -> bool {
135+
self.import_name_type == Some(PeImportNameType::Undecorated)
136+
|| self.import_name_type == Some(PeImportNameType::NoPrefix)
137+
}
133138
}
134139

135140
/// Calling convention for a function defined in an external library.

‎compiler/rustc_smir/src/rustc_smir/context.rs

+15-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ use stable_mir::{Crate, CrateDef, CrateItem, CrateNum, DefId, Error, Filename, I
3434

3535
use crate::rustc_internal::RustcInternal;
3636
use crate::rustc_smir::builder::BodyBuilder;
37-
use crate::rustc_smir::{Stable, Tables, alloc, new_item_kind, smir_crate};
37+
use crate::rustc_smir::{Stable, Tables, alloc, filter_def_ids, new_item_kind, smir_crate};
3838

3939
impl<'tcx> Context for TablesWrapper<'tcx> {
4040
fn target_info(&self) -> MachineInfo {
@@ -80,6 +80,20 @@ impl<'tcx> Context for TablesWrapper<'tcx> {
8080
.collect()
8181
}
8282

83+
fn crate_functions(&self, crate_num: CrateNum) -> Vec<FnDef> {
84+
let mut tables = self.0.borrow_mut();
85+
let tcx = tables.tcx;
86+
let krate = crate_num.internal(&mut *tables, tcx);
87+
filter_def_ids(tcx, krate, |def_id| tables.to_fn_def(def_id))
88+
}
89+
90+
fn crate_statics(&self, crate_num: CrateNum) -> Vec<StaticDef> {
91+
let mut tables = self.0.borrow_mut();
92+
let tcx = tables.tcx;
93+
let krate = crate_num.internal(&mut *tables, tcx);
94+
filter_def_ids(tcx, krate, |def_id| tables.to_static(def_id))
95+
}
96+
8397
fn foreign_module(
8498
&self,
8599
mod_def: stable_mir::ty::ForeignModuleDef,
There was a problem loading the remainder of the diff.

0 commit comments

Comments
 (0)
Failed to load comments.