diff options
| author | Nicholas Nethercote <nnethercote@mozilla.com> | 2020-07-30 11:27:50 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <nnethercote@mozilla.com> | 2020-08-08 12:03:42 +1000 |
| commit | e539dd65f8ba80837f7477c0547c61514bceb3ad (patch) | |
| tree | 4d52e0a8cb566c47f9f189b7d11af5095d65eb2d /src/librustc_codegen_ssa | |
| parent | d6fa011f62ee0c3b256d0be9a69369cbceb3c45b (diff) | |
| download | rust-e539dd65f8ba80837f7477c0547c61514bceb3ad.tar.gz rust-e539dd65f8ba80837f7477c0547c61514bceb3ad.zip | |
Eliminate the `SessionGlobals` from `librustc_ast`.
By moving `{known,used}_attrs` from `SessionGlobals` to `Session`. This
means they are accessed via the `Session`, rather than via TLS. A few
`Attr` methods and `librustc_ast` functions are now methods of
`Session`.
All of this required passing a `Session` to lots of functions that didn't
already have one. Some of these functions also had arguments removed, because
those arguments could be accessed directly via the `Session` argument.
`contains_feature_attr()` was dead, and is removed.
Some functions were moved from `librustc_ast` elsewhere because they now need
to access `Session`, which isn't available in that crate.
- `entry_point_type()` --> `librustc_builtin_macros`
- `global_allocator_spans()` --> `librustc_metadata`
- `is_proc_macro_attr()` --> `Session`
Diffstat (limited to 'src/librustc_codegen_ssa')
| -rw-r--r-- | src/librustc_codegen_ssa/back/write.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/librustc_codegen_ssa/back/write.rs b/src/librustc_codegen_ssa/back/write.rs index b0fae566a5a..d13c2d29d17 100644 --- a/src/librustc_codegen_ssa/back/write.rs +++ b/src/librustc_codegen_ssa/back/write.rs @@ -9,7 +9,6 @@ use crate::{ use crate::traits::*; use jobserver::{Acquired, Client}; -use rustc_ast::attr; use rustc_data_structures::fx::FxHashMap; use rustc_data_structures::profiling::SelfProfilerRef; use rustc_data_structures::profiling::TimingGuard; @@ -416,11 +415,12 @@ pub fn start_async_codegen<B: ExtraBackendMethods>( let crate_name = tcx.crate_name(LOCAL_CRATE); let crate_hash = tcx.crate_hash(LOCAL_CRATE); - let no_builtins = attr::contains_name(&tcx.hir().krate().item.attrs, sym::no_builtins); + let no_builtins = tcx.sess.contains_name(&tcx.hir().krate().item.attrs, sym::no_builtins); let is_compiler_builtins = - attr::contains_name(&tcx.hir().krate().item.attrs, sym::compiler_builtins); - let subsystem = - attr::first_attr_value_str_by_name(&tcx.hir().krate().item.attrs, sym::windows_subsystem); + tcx.sess.contains_name(&tcx.hir().krate().item.attrs, sym::compiler_builtins); + let subsystem = tcx + .sess + .first_attr_value_str_by_name(&tcx.hir().krate().item.attrs, sym::windows_subsystem); let windows_subsystem = subsystem.map(|subsystem| { if subsystem != sym::windows && subsystem != sym::console { tcx.sess.fatal(&format!( |
