about summary refs log tree commit diff
path: root/src/librustc_interface
AgeCommit message (Collapse)AuthorLines
2019-11-13Enable const-checking HIR bodiesDylan MacKenzie-0/+1
2019-11-13Rollup merge of #66335 - Mark-Simulacrum:self-profile-to-data, ↵Yuki Okushi-0/+4
r=michaelwoerister Move self-profile infrastructure to data structures The single dependency on queries (QueryName) can be fairly easily abstracted via a trait and this further decouples Session from librustc (the primary goal). This is intended as a precursor to moving Session out of librustc, but since that involves lots of smaller steps that move around code I'm splitting it up into separate PRs.
2019-11-12Register queries with self profiler in rustc_interfaceMark Rousskov-0/+4
2019-11-11Add a callback that allows compiler consumers to override queries.Vytautas Astrauskas-0/+16
2019-11-10Auto merge of #65324 - Centril:organize-syntax, r=petrochenkovbors-47/+40
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-9/+10
also move MACRO_ARGUMENTS -> librustc_parse
2019-11-10move config.rs to libsyntax_expandMazdak Farrokhzad-39/+31
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-19/+20
This doesn't migrate the pretty-printing everybody loops, which will be done in the next few commits.
2019-11-08ast::ItemKind::Fn: use ast::FnSigMazdak Farrokhzad-6/+7
2019-11-08ast::MethodSig -> ast::FnSigMazdak Farrokhzad-2/+2
2019-11-07move PResult to librustc_errorsMazdak Farrokhzad-1/+2
2019-11-07syntax::parser::token -> syntax::tokenMazdak Farrokhzad-1/+1
2019-11-07syntax: use distinct FloatTy from rustc_target.Mazdak Farrokhzad-1/+3
We also sever syntax's dependency on rustc_target as a result. This should slightly improve pipe-lining. Moreover, some cleanup is done in related code.
2019-11-06Rollup merge of #66086 - RalfJung:smallvec, r=nagisaMazdak Farrokhzad-1/+1
bump smallvec to 1.0 This includes https://github.com/servo/rust-smallvec/pull/162, fixing an unsoundness in smallvec. See https://github.com/servo/rust-smallvec/pull/175 for the 1.0 release announcement. Cc @mbrubeck @emilio
2019-11-06Rollup merge of #66068 - euclio:null-emitter, r=estebankMazdak Farrokhzad-12/+2
use silent emitter for rustdoc highlighting pass Partially addresses #63284.
2019-11-04bump smallvec to 1.0Ralf Jung-1/+1
2019-11-03use silent emitter for rustdoc highlighting passAndy Russell-12/+2
2019-11-03Delete lint buffer from SessionMark Rousskov-6/+6
2019-11-03Move crate type checking laterMark Rousskov-50/+61
This allows us to directly pass in a lint buffer
2019-11-03Utilize Resolver lint buffer during HIR loweringMark Rousskov-2/+2
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-28/+14
2019-10-24Turn crate store into a resolver outputVadim Petrochenkov-44/+33
2019-10-24rustc: Combine resolver outputs into a single structVadim Petrochenkov-14/+9
2019-10-24resolve: Privatize all resolver fieldsVadim Petrochenkov-38/+5
2019-10-24rustc_metadata: Remove unnecessary use of crate store in plugin loaderVadim Petrochenkov-5/+4
2019-10-23Rollup merge of #65193 - Mark-Simulacrum:lockless-lintstore, r=nikomatsakisMazdak Farrokhzad-31/+56
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/+773
2019-10-17Update API to be more compatible with plugin needsMark Rousskov-0/+14
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-35/+31
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-5/+6
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/+5
2019-10-14Rollup merge of #65340 - bjorn3:cg_ssa_refactor4, r=eddybTyler Mandry-0/+3
Several changes to the codegen backend organization * Split functions from values in cg_ssa `BackendTypes`. * Remove `is_const_integral` function from `ConstMethods`. * Actually register the invalid monomorphization of intrinsic long diagnostic and remove the `diagnostics` method from `CodegenBackends`, as it was unused. * Add cg_ssa and cg_utils provided methods to `default_provide`, so codegen backend don't have to do it themself.
2019-10-14rustc_metadata: Remove resolutions for extern crate items from `CStore`Vadim Petrochenkov-0/+2
Use a more traditional scheme with providing them as a resolver output
2019-10-14rustc_metadata: Crate loader is immutableVadim Petrochenkov-3/+3
2019-10-14rustc_metadata: Privatize private code and remove dead codeVadim Petrochenkov-8/+7
2019-10-13lowering: connect to parser via function pointer insteadMazdak Farrokhzad-16/+4
2019-10-13lowering: don't rely on parser directly.Mazdak Farrokhzad-3/+16
2019-10-13Add top level provide/provide_extern to cg_ssa and cg_utilsbjorn3-5/+3
2019-10-13Move some provides from cg_llvm to rustc_interfacebjorn3-0/+5
2019-10-09self-profiling: Add events for everything except trait selection.Michael Woerister-0/+2