summary refs log tree commit diff
path: root/src/librustc_interface/passes.rs
AgeCommit message (Collapse)AuthorLines
2019-12-06Rename to `then_some` and `then`varkor-1/+1
2019-12-06Use `to_option_with` in several placesvarkor-1/+1
2019-12-06Use `to_option` in various placesvarkor-7/+1
2019-12-03Move early lint declarations to librustc_sessionMark Rousskov-2/+1
2019-12-01rustc_plugin: Some further cleanupVadim Petrochenkov-2/+1
Remove a useless test
2019-12-01rustc_plugin: Remove support for plugins adding LLVM passesVadim Petrochenkov-10/+5
2019-12-01rustc_plugin: Remove support for adding plugins from command lineVadim Petrochenkov-8/+2
2019-12-01rustc_plugin: Remove support for plugin argumentsVadim Petrochenkov-2/+1
2019-11-29Rollup merge of #66791 - cjgillot:arena, r=Mark-SimulacrumRalf Jung-67/+52
Handle GlobalCtxt directly from librustc_interface query system This PR constructs the `GlobalCtxt` as a member of the `Queries` in librustc_interface. This simplifies the code to construct it, at the expense of added complexity in the query control flow. This allows to handle the arenas directly from librustc_interface. Based on #66707 r? @Zoxc
2019-11-28rustc_metadata: Merge `cstore.rs` into `creader.rs`Vadim Petrochenkov-3/+2
2019-11-27Misc renames.Camille GILLOT-4/+3
2019-11-27Simplify handling of AllArenas.Camille GILLOT-3/+2
2019-11-27Rename BoxedGlobalCtxt.Camille GILLOT-4/+4
2019-11-27Rename lifetimes.Camille GILLOT-9/+9
2019-11-26Move local Arena to Queries.Camille GILLOT-1/+4
2019-11-26Formatting.Camille GILLOT-37/+35
2019-11-26Have Queries own the GlobalCtxt.Camille GILLOT-35/+21
The construction of the GlobalCtxt is moved from a generator's stack to the Queries struct. Since the GlobalCtxt requires the HIR Forest and the arenas to live longer, those are moved into Queries the same way. The resulting handling of objects is more brittle, because consumers of the Once objects need to be careful of their initialisation.
2019-11-26Make the HIR map own the Definitions.Camille GILLOT-1/+1
2019-11-24rustc_plugin: Remove support for syntactic pluginsVadim Petrochenkov-16/+4
2019-11-22Rollup merge of #66575 - Mark-Simulacrum:no-uii, r=petrochenkovMazdak Farrokhzad-1/+1
Remove pretty printing of specific nodes in AST The ability to print a specific item as identified by NodeId or path seems not particularly useful, and certainly carries quite a bit of complexity with it. This is intended to simplify our CLI parsing a bit and remove a non-uncomplicated piece of it; I largely did this to remove the dependency on NodeId from librustc/session but it's not really necessary to do so in this invasive a way. The alternative is moving it to librustc_interface or driver, probably.
2019-11-20Remove pretty printing of specific nodes in ASTMark Rousskov-1/+1
The ability to print a specific item as identified by NodeId or path seems not particularly useful, and certainly carries quite a bit of complexity with it.
2019-11-17rustc_plugin: Remove the compatibility shimVadim Petrochenkov-2/+2
2019-11-16rustc_plugin: Remove `Registry::register_attribute`Vadim Petrochenkov-8/+1
2019-11-13Enable const-checking HIR bodiesDylan MacKenzie-0/+1
2019-11-11Add a callback that allows compiler consumers to override queries.Vytautas Astrauskas-0/+5
2019-11-10Auto merge of #65324 - Centril:organize-syntax, r=petrochenkovbors-9/+8
Split libsyntax apart In this PR the general idea is to separate the AST, parser, and friends by a more data / logic structure (tho not fully realized!) by separating out the parser and macro expansion code from libsyntax. Specifically have now three crates instead of one (libsyntax): - libsyntax: - concrete syntax tree (`syntax::ast`) - definition of tokens and token-streams (`syntax::{token, tokenstream}`) -- used by `syntax::ast` - visitors (`syntax::visit`, `syntax::mut_visit`) - shared definitions between `libsyntax_expand` - feature gating (`syntax::feature_gate`) -- we could possibly move this out to its own crater later. - attribute and meta item utilities, including used-marking (`syntax::attr`) - pretty printer (`syntax::print`) -- this should possibly be moved out later. For now I've reduced down the dependencies to a single essential one which could be broken via `ParseSess`. This entails that e.g. `Debug` impls for `Path` cannot reference the pretty printer. - definition of `ParseSess` (`syntax::sess`) -- this is used by `syntax::{attr, print, feature_gate}` and is a common definition used by the parser and other things like librustc. - the `syntax::source_map` -- this includes definitions used by `syntax::ast` and other things but could ostensibly be moved `syntax_pos` since that is more related to this module. - a smattering of misc utilities not sufficiently important to itemize -- some of these could be moved to where they are used (often a single place) but I wanted to limit the scope of this PR. - librustc_parse: - parser (`rustc_parse::parser`) -- reading a file and such are defined in the crate root tho. - lexer (`rustc_parse::lexer`) - validation of meta grammar (post-expansion) in (`rustc_parse::validate_attr`) - libsyntax_expand -- this defines the infra for macro expansion and conditional compilation but this is not libsyntax_ext; we might want to merge them later but currently libsyntax_expand is depended on by librustc_metadata which libsyntax_ext is not. - conditional compilation (`syntax_expand::config`) -- moved from `syntax::config` to here - the bulk of this crate is made up of the old `syntax::ext` r? @estebank
2019-11-10move syntax::parse -> librustc_parseMazdak Farrokhzad-8/+7
also move MACRO_ARGUMENTS -> librustc_parse
2019-11-10move config.rs to libsyntax_expandMazdak Farrokhzad-1/+1
2019-11-09Move pretty parsing into Session optionsMark Rousskov-1/+6
This allows us to query whether PpmEveryBodyLoops is set during expansion and run the everybody loops pass.
2019-11-09Move next_node_id to ResolverMark Rousskov-1/+1
This doesn't migrate the pretty-printing everybody loops, which will be done in the next few commits.
2019-11-07move PResult to librustc_errorsMazdak Farrokhzad-1/+2
2019-11-03Delete lint buffer from SessionMark Rousskov-6/+6
2019-11-03Move crate type checking laterMark Rousskov-0/+2
This allows us to directly pass in a lint buffer
2019-11-03Migrate resolver over to internal lint bufferMark Rousskov-3/+5
2019-10-27rustc, rustc_passes: don't depend on syntax_expand.Mazdak Farrokhzad-1/+1
This is done by moving some data definitions to syntax::expand.
2019-10-24rustc_interface: Remove `ExpansionResult` and some `Steal`sVadim Petrochenkov-21/+4
2019-10-24Turn crate store into a resolver outputVadim Petrochenkov-31/+29
2019-10-24rustc: Combine resolver outputs into a single structVadim Petrochenkov-12/+8
2019-10-24resolve: Privatize all resolver fieldsVadim Petrochenkov-38/+5
2019-10-24rustc_metadata: Remove unnecessary use of crate store in plugin loaderVadim Petrochenkov-4/+3
2019-10-17Update API to be more compatible with plugin needsMark Rousskov-0/+3
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-17Create lint store during plugin registrationMark Rousskov-22/+16
Remove lint store from Session
2019-10-17Remove all borrows of lint store from Session from librustcMark Rousskov-1/+8
Access through tcx is fine -- by that point, the lint store is frozen, but direct access through Session will go away in future commits, as lint store is still mutable in early stages of Session, and will be removed completely.
2019-10-17Make get_lints be a static functionMark Rousskov-2/+2
This moves from calling get_lints on instantiated pass objects to the raw object
2019-10-17No longer implicitly register lints when registering passesMark Rousskov-0/+2
This is in preparation for on-demand constructing passes
2019-10-17Split out just registration to separate functionMark Rousskov-2/+2
2019-10-17Split module and crate late pass registrationMark Rousskov-1/+1
2019-10-17Lints being from a plugin is dependent on the lint, not the registrationMark Rousskov-2/+2
2019-10-17De-propagate optional session from lint registrationMark Rousskov-3/+3
This is straight up removing dead code, but is a separate commit from the previous to avoid conflating clean up and important changes.
2019-10-16move syntax::ext to new crate syntax_expandMazdak Farrokhzad-4/+4