about summary refs log tree commit diff
path: root/src/librustc_interface/interface.rs
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-209/+0
2020-08-17rust_ast::ast => rustc_astUjjwal Sharma-1/+1
2020-08-15replaced log with tracingGurpreet Singh-1/+1
2020-08-08Eliminate the `SessionGlobals` from `librustc_ast`.Nicholas Nethercote-1/+1
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`
2020-08-05Remove `setup_callbacks_and_run_in_default_thread_pool_with_globals()`.Nicholas Nethercote-11/+0
It's a very thin wrapper around `setup_callbacks_and_run_in_thread_pool_with_globals()` and it has a single call site.
2020-07-10Change some function names.Nicholas Nethercote-8/+8
A couple of these are quite long, but they do a much better job of explaining what they do, which was non-obvious before.
2020-07-09Rollup merge of #74079 - nnethercote:session-globals, r=nikomatsakisManish Goregaokar-1/+1
Eliminate confusing "globals" terminology. There are some structures that are called "globals", but are they global to a compilation session, and not truly global. I have always found this highly confusing, so this commit renames them as "session globals" and adds a comment explaining things. Also, the commit fixes an unnecessary nesting of `set()` calls `src/librustc_errors/json/tests.rs` r? @Aaron1011
2020-07-09Eliminate confusing "globals" terminology.Nicholas Nethercote-1/+1
There are some structures that are called "globals", but are they global to a compilation session, and not truly global. I have always found this highly confusing, so this commit renames them as "session globals" and adds a comment explaining things. Also, the commit fixes an unnecessary nesting of `set()` calls `src/librustc_errors/json/tests.rs`
2020-07-05Use for<'tcx> fn pointers in Providers, instead of having Providers<'tcx>.Eduard-Mihai Burtescu-2/+2
2020-06-19Fix -Z unpretty=everybody_loopsJoshua Nelson-0/+1
It turns out that this has not been working for who knows how long. Previously: ``` pub fn h() { 1 + 2; } ``` After this change: ``` pub fn h() { loop {} } ``` This only affected the pass when run with the command line pretty-printing option, so rustdoc was still replacing bodies with `loop {}`.
2020-05-31Make `SourceMap` available for early debug-printing of `Span`sAaron Hill-11/+13
Normally, we debug-print `Spans` using the `SourceMap` retrieved from the global `TyCtxt`. However, we fall back to printing out the `Span`'s raw fields (instead of a file and line number) when we try to print a `Span` before a `TyCtxt` is available. This makes debugging early phases of the compile, such as parsing, much more difficult. This commit stores a `SourceMap` in `rustc_span::GlOBALS` as a fallback. When a `TyCtxt` is not available, we try to retrieve one from `GLOBALS` - only if this is not available do we fall back to the raw field output. I'm not sure how to write a test for this - however, this can be verified locally by setting `RUSTC_LOG="rustc_parse=debug"`, and verifying that the output contains filenames and line numbers.
2020-05-27rustc_session: Cleanup session creationVadim Petrochenkov-7/+2
2020-05-02fix miri-unleash delayed sanity checkingRalf Jung-1/+1
2020-04-02use direct import for ErrorReportedMazdak Farrokhzad-1/+1
2020-03-30rustc -> rustc_middle part 3 (rustfmt)Mazdak Farrokhzad-2/+2
2020-03-30rustc -> rustc_middle part 2Mazdak Farrokhzad-2/+2
2020-03-19Refactorings to begin getting rid of rustc_codegen_utilsMark Mansi-1/+1
2020-03-16use direct imports for `rustc::{lint, session}`.Mazdak Farrokhzad-4/+4
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-3/+3
2020-02-11Support linking from a .rlink fileVictor Ding-2/+15
Flag `-Z no-link` was previously introduced, which allows creating an `.rlink` file to perform compilation without linking. This change enables linking from an `.rlink` file.
2020-02-01syntax: reexport attr globalsMazdak Farrokhzad-1/+1
2020-02-011. move node_id to syntaxMazdak Farrokhzad-3/+3
2. invert rustc_session & syntax deps 3. drop rustc_session dep in rustc_hir
2020-02-01syntax: move GLOBALS to attr moduleMazdak Farrokhzad-1/+1
2020-01-11move rustc::lint::{context, passes} to rustc_lint.Mazdak Farrokhzad-2/+3
Also do some cleanup of the interface.
2020-01-09Label unmarked timeJohn Kåre Alsaker-4/+10
2020-01-02Normalize `syntax::source_map` imports.Mazdak Farrokhzad-1/+1
2020-01-01Rename `syntax_pos` to `rustc_span` in source codeVadim Petrochenkov-1/+1
2019-12-22Format the worldMark Rousskov-40/+45
2019-12-19Fix documentation typoLeSeulArtichaut-1/+1
2019-11-24Isolate compiler queries inside the Queries type.Camille GILLOT-3/+0
2019-11-20Delete ProcessCfgModMark Rousskov-2/+1
The previous commit removes the use of this, and now we cleanup.
2019-11-16move DIAGNOSTICS usage to rustc_driverMazdak Farrokhzad-15/+13
2019-11-11Add a callback that allows compiler consumers to override queries.Vytautas Astrauskas-0/+11
2019-11-10move syntax::parse -> librustc_parseMazdak Farrokhzad-1/+1
also move MACRO_ARGUMENTS -> librustc_parse
2019-11-10move config.rs to libsyntax_expandMazdak Farrokhzad-3/+4
2019-11-07syntax::parser::token -> syntax::tokenMazdak Farrokhzad-1/+1
2019-11-03use silent emitter for rustdoc highlighting passAndy Russell-12/+2
2019-10-24Turn crate store into a resolver outputVadim Petrochenkov-8/+0
2019-10-23Rollup merge of #65193 - Mark-Simulacrum:lockless-lintstore, r=nikomatsakisMazdak Farrokhzad-0/+9
Lockless LintStore This removes mutability from the lint store after registration. Each commit stands alone, for the most part, though they don't make sense out of sequence. The intent here is to move LintStore to a more parallel-friendly architecture, although also just a cleaner one from an implementation perspective. Specifically, this has the following changes: * We no longer implicitly register lints when registering lint passes * For the most part this means that registration calls now likely want to call something like: `lint_store.register_lints(&Pass::get_lints())` as well as `register_*_pass`. * In theory this is a simplification as it's much easier for folks to just register lints and then have passes that implement whichever lint however they want, rather than necessarily tying passes to lints. * Lint passes still have a list of associated lints, but a followup PR could plausibly change that * This list must be known for a given pass type, not instance, i.e., `fn get_lints()` is the signature instead of `fn get_lints(&self)` as before. * We do not store pass objects, instead storing constructor functions. This means we always get new passes when running lints (this happens approximately once though for a given compiler session, so no behavior change is expected). * Registration API is _much_ simpler: generally all functions are just taking `Fn() -> PassObject` rather than several different `bool`s.
2019-10-22Add some documentationMark Rousskov-0/+5
2019-10-19move parse_cfgspecs to rustc_interfaceMazdak Farrokhzad-3/+60
2019-10-17Update API to be more compatible with plugin needsMark Rousskov-0/+4
Move to using Box<dyn Fn() -> ...> so that we can let plugins register state. This also adds a callback that'll get called from plugin registration so that Clippy and other tools can register lints without using the plugin API. The plugin API still works, but this new API is more compatible with drivers other than rustc.
2019-10-03Remove -Zprofile-queriesMark Rousskov-12/+1
2019-09-30Make the default parallelism 1Mark Rousskov-1/+4
This changes the default parallelism for parallel compilers to one, instead of the previous default, which was "num cpus". This is likely not an optimal default long-term, but it is a good default for testing whether parallel compilers are not a significant regression over a sequential compiler. Notably, this in theory makes a parallel-enabled compiler behave exactly like a sequential compiler with respect to the jobserver.
2019-07-28Remove lint annotations in specific crates that are already enforced by ↵Vadim Petrochenkov-1/+0
rustbuild Remove some random unnecessary lint `allow`s
2019-05-21Specify the edition for the rustdoc thread-poolJohn Kåre Alsaker-2/+2
2019-05-21Move `edition` outside the hygiene lock and avoid accessing itJohn Kåre Alsaker-1/+3
2019-04-18hide `--explain` hint if error has no extended infoAndy Russell-1/+3
2019-04-12Use measureme in self-profilerWesley Wiser-4/+0
Related to #58372 Related to #58967
2019-04-03Deny internal lints on librustc_interfaceflip1995-1/+0