Skip to content

Commit 400d0df

Browse files
authored
Rollup merge of rust-lang#61153 - Centril:rollup-b9qpiez, r=Centril
Rollup of 5 pull requests Successful merges: - rust-lang#60928 (Changes the type `mir::Mir` into `mir::Body`) - rust-lang#61035 (Avoid more symbol interning) - rust-lang#61036 (PGO - Add a smoketest for combining PGO with cross-language LTO.) - rust-lang#61077 (Don't arena-allocate static symbols.) - rust-lang#61080 (Ship profiler with windows-gnu) Failed merges: r? @ghost
2 parents cc3d058 + c907f03 commit 400d0df

File tree

150 files changed

+899
-690
lines changed

Some content is hidden

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

150 files changed

+899
-690
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2998,6 +2998,7 @@ dependencies = [
29982998
"rustc_cratesio_shim 0.0.0",
29992999
"rustc_data_structures 0.0.0",
30003000
"serialize 0.0.0",
3001+
"syntax_pos 0.0.0",
30013002
]
30023003

30033004
[[package]]

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ environment:
104104
DEPLOY: 1
105105
- CI_JOB_NAME: dist-i686-mingw
106106
MSYS_BITS: 32
107-
RUST_CONFIGURE_ARGS: --build=i686-pc-windows-gnu --enable-full-tools
107+
RUST_CONFIGURE_ARGS: --build=i686-pc-windows-gnu --enable-full-tools --enable-profiler
108108
SCRIPT: python x.py dist
109109
MINGW_URL: https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror
110110
MINGW_ARCHIVE: i686-6.3.0-release-posix-dwarf-rt_v5-rev2.7z
@@ -114,7 +114,7 @@ environment:
114114
- CI_JOB_NAME: dist-x86_64-mingw
115115
MSYS_BITS: 64
116116
SCRIPT: python x.py dist
117-
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnu --enable-full-tools
117+
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnu --enable-full-tools --enable-profiler
118118
MINGW_URL: https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror
119119
MINGW_ARCHIVE: x86_64-6.3.0-release-posix-seh-rt_v5-rev2.7z
120120
MINGW_DIR: mingw64

src/bootstrap/native.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ impl Step for Llvm {
204204
}
205205

206206
if want_lldb {
207-
cfg.define("LLVM_ENABLE_PROJECTS", "clang;lldb");
207+
cfg.define("LLVM_ENABLE_PROJECTS", "clang;lldb;compiler-rt");
208208
// For the time being, disable code signing.
209209
cfg.define("LLDB_CODESIGN_IDENTITY", "");
210210
cfg.define("LLDB_NO_DEBUGSERVER", "ON");

src/libprofiler_builtins/build.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ fn main() {
4141
cfg.flag("-fomit-frame-pointer");
4242
cfg.flag("-ffreestanding");
4343
cfg.define("VISIBILITY_HIDDEN", None);
44-
cfg.define("COMPILER_RT_HAS_UNAME", Some("1"));
44+
if !target.contains("windows") {
45+
cfg.define("COMPILER_RT_HAS_UNAME", Some("1"));
46+
} else {
47+
profile_sources.push("WindowsMMap.c");
48+
}
4549
}
4650

4751
// Assume that the Unixes we are building this for have fnctl() available

src/librustc/hir/lowering.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,9 +1145,7 @@ impl<'a> LoweringContext<'a> {
11451145
let unstable_span = self.sess.source_map().mark_span_with_reason(
11461146
CompilerDesugaringKind::Async,
11471147
span,
1148-
Some(vec![
1149-
Symbol::intern("gen_future"),
1150-
].into()),
1148+
Some(vec![sym::gen_future].into()),
11511149
);
11521150
let gen_future = self.expr_std_path(
11531151
unstable_span, &[sym::future, sym::from_generator], None, ThinVec::new());
@@ -2958,7 +2956,7 @@ impl<'a> LoweringContext<'a> {
29582956
ident: match f.ident {
29592957
Some(ident) => ident,
29602958
// FIXME(jseyfried): positional field hygiene
2961-
None => Ident::new(Symbol::intern(&index.to_string()), f.span),
2959+
None => Ident::new(sym::integer(index), f.span),
29622960
},
29632961
vis: self.lower_visibility(&f.vis, None),
29642962
ty: self.lower_ty(&f.ty, ImplTraitContext::disallowed()),
@@ -4177,9 +4175,7 @@ impl<'a> LoweringContext<'a> {
41774175
let unstable_span = this.sess.source_map().mark_span_with_reason(
41784176
CompilerDesugaringKind::TryBlock,
41794177
body.span,
4180-
Some(vec![
4181-
Symbol::intern("try_trait"),
4182-
].into()),
4178+
Some(vec![sym::try_trait].into()),
41834179
);
41844180
let mut block = this.lower_block(body, true).into_inner();
41854181
let tail = block.expr.take().map_or_else(

src/librustc/hir/map/def_collector.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ use crate::session::CrateDisambiguator;
55
use syntax::ast::*;
66
use syntax::ext::hygiene::Mark;
77
use syntax::visit;
8-
use syntax::symbol::kw;
9-
use syntax::symbol::Symbol;
8+
use syntax::symbol::{kw, sym};
109
use syntax::parse::token::{self, Token};
1110
use syntax_pos::Span;
1211

@@ -221,7 +220,7 @@ impl<'a> visit::Visitor<'a> for DefCollector<'a> {
221220
_: &'a Generics, _: NodeId, _: Span) {
222221
for (index, field) in data.fields().iter().enumerate() {
223222
let name = field.ident.map(|ident| ident.name)
224-
.unwrap_or_else(|| Symbol::intern(&index.to_string()));
223+
.unwrap_or_else(|| sym::integer(index));
225224
let def = self.create_def(field.id,
226225
DefPathData::ValueNs(name.as_interned_str()),
227226
field.span);

src/librustc/middle/lang_items.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,8 @@ impl<'a, 'tcx> LanguageItemCollector<'a, 'tcx> {
210210
pub fn extract(attrs: &[ast::Attribute]) -> Option<(Symbol, Span)> {
211211
attrs.iter().find_map(|attr| Some(match attr {
212212
_ if attr.check_name(sym::lang) => (attr.value_str()?, attr.span),
213-
_ if attr.check_name(sym::panic_handler) => (Symbol::intern("panic_impl"), attr.span),
214-
_ if attr.check_name(sym::alloc_error_handler) => (Symbol::intern("oom"), attr.span),
213+
_ if attr.check_name(sym::panic_handler) => (sym::panic_impl, attr.span),
214+
_ if attr.check_name(sym::alloc_error_handler) => (sym::oom, attr.span),
215215
_ => return None,
216216
}))
217217
}

src/librustc/middle/mem_categorization.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,7 +1316,7 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> {
13161316

13171317
for (i, subpat) in subpats.iter().enumerate_and_adjust(expected_len, ddpos) {
13181318
let subpat_ty = self.pat_ty_adjusted(&subpat)?; // see (*2)
1319-
let interior = InteriorField(FieldIndex(i, Name::intern(&i.to_string())));
1319+
let interior = InteriorField(FieldIndex(i, sym::integer(i)));
13201320
let subcmt = Rc::new(
13211321
self.cat_imm_interior(pat, cmt.clone(), subpat_ty, interior));
13221322
self.cat_pattern_(subcmt, &subpat, op)?;
@@ -1363,7 +1363,7 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> {
13631363
};
13641364
for (i, subpat) in subpats.iter().enumerate_and_adjust(expected_len, ddpos) {
13651365
let subpat_ty = self.pat_ty_adjusted(&subpat)?; // see (*2)
1366-
let interior = InteriorField(FieldIndex(i, Name::intern(&i.to_string())));
1366+
let interior = InteriorField(FieldIndex(i, sym::integer(i)));
13671367
let subcmt = Rc::new(
13681368
self.cat_imm_interior(pat, cmt.clone(), subpat_ty, interior));
13691369
self.cat_pattern_(subcmt, &subpat, op)?;

src/librustc/middle/stability.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ impl<'a, 'tcx> Index<'tcx> {
437437
reason: Some(Symbol::intern(reason)),
438438
issue: 27812,
439439
},
440-
feature: Symbol::intern("rustc_private"),
440+
feature: sym::rustc_private,
441441
rustc_depr: None,
442442
const_stability: None,
443443
promotable: false,
@@ -880,7 +880,7 @@ pub fn check_unused_or_stable_features<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
880880
// FIXME: only remove `libc` when `stdbuild` is active.
881881
// FIXME: remove special casing for `test`.
882882
remaining_lib_features.remove(&Symbol::intern("libc"));
883-
remaining_lib_features.remove(&Symbol::intern("test"));
883+
remaining_lib_features.remove(&sym::test);
884884

885885
let check_features =
886886
|remaining_lib_features: &mut FxHashMap<_, _>, defined_features: &[_]| {

src/librustc/mir/cache.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use rustc_data_structures::sync::{RwLock, MappedReadGuard, ReadGuard};
33
use rustc_data_structures::stable_hasher::{HashStable, StableHasher,
44
StableHasherResult};
55
use crate::ich::StableHashingContext;
6-
use crate::mir::{Mir, BasicBlock};
6+
use crate::mir::{Body, BasicBlock};
77

88
use crate::rustc_serialize as serialize;
99

@@ -47,7 +47,7 @@ impl Cache {
4747

4848
pub fn predecessors(
4949
&self,
50-
mir: &Mir<'_>
50+
mir: &Body<'_>
5151
) -> MappedReadGuard<'_, IndexVec<BasicBlock, Vec<BasicBlock>>> {
5252
if self.predecessors.borrow().is_none() {
5353
*self.predecessors.borrow_mut() = Some(calculate_predecessors(mir));
@@ -57,7 +57,7 @@ impl Cache {
5757
}
5858
}
5959

60-
fn calculate_predecessors(mir: &Mir<'_>) -> IndexVec<BasicBlock, Vec<BasicBlock>> {
60+
fn calculate_predecessors(mir: &Body<'_>) -> IndexVec<BasicBlock, Vec<BasicBlock>> {
6161
let mut result = IndexVec::from_elem(vec![], mir.basic_blocks());
6262
for (bb, data) in mir.basic_blocks().iter_enumerated() {
6363
if let Some(ref term) = data.terminator {

0 commit comments

Comments
 (0)