summary refs log tree commit diff
path: root/src/librustc_interface
AgeCommit message (Collapse)AuthorLines
2019-12-11rustc: Link LLVM directly into rustc againAlex Crichton-77/+12
This commit builds on #65501 continue to simplify the build system and compiler now that we no longer have multiple LLVM backends to ship by default. Here this switches the compiler back to what it once was long long ago, which is linking LLVM directly to the compiler rather than dynamically loading it at runtime. The `codegen-backends` directory of the sysroot no longer exists and all relevant support in the build system is removed. Note that `rustc` still supports a dynamically loaded codegen backend as it did previously, it just no longer supports dynamically loaded codegen backends in its own sysroot. Additionally as part of this the `librustc_codegen_llvm` crate now once again explicitly depends on all of its crates instead of implicitly loading them through the sysroot. This involved filling out its `Cargo.toml` and deleting all the now-unnecessary `extern crate` annotations in the header of the crate. (this in turn required adding a number of imports for names of macros too). The end results of this change are: * Rustbuild's build process for the compiler as all the "oh don't forget the codegen backend" checks can be easily removed. * Building `rustc_codegen_llvm` is much simpler since it's simply another compiler crate. * Managing the dependencies of `rustc_codegen_llvm` is much simpler since it's "just another `Cargo.toml` to edit" * The build process should be a smidge faster because there's more parallelism in the main rustc build step rather than splitting `librustc_codegen_llvm` out to its own step. * The compiler is expected to be slightly faster by default because the codegen backend does not need to be dynamically loaded. * Disabling LLVM as part of rustbuild is still supported, supporting multiple codegen backends is still supported, and dynamic loading of a codegen backend is still supported.
2019-12-11Rollup merge of #67074 - ehuss:extern-options, r=petrochenkovMazdak Farrokhzad-11/+12
Add options to --extern flag. This changes the `--extern` flag so that it can take a series of options that changes its behavior. The general syntax is `[opts ':'] name ['=' path]` where `opts` is a comma separated list of options. Two options are supported, `priv` which replaces `--extern-private` and `noprelude` which avoids adding the crate to the extern prelude. ```text --extern priv:mylib=/path/to/libmylib.rlib --extern noprelude:alloc=/path/to/liballoc.rlib ``` `noprelude` is to be used by Cargo's build-std feature in order to use `--extern` to reference standard library crates. This also includes a second commit which adds the `aux-crate` directive to compiletest. I can split this off into a separate PR if desired, but it helps with defining these kinds of tests. It is based on #54020, and can be used in the future to replace and simplify some of the Makefile tests.
2019-12-09Add options to --extern flag.Eric Huss-11/+12
2019-12-06Auto merge of #65195 - varkor:to_option, r=Centrilbors-22/+7
Rename `bool::then_*` to `bool::to_option_*` and use where appropriate Name change following https://github.com/rust-lang/rfcs/pull/2757. Also try it out throughout the compiler in places I think makes the code more readable.
2019-12-06Rename to `then_some` and `then`varkor-4/+4
2019-12-06Use `to_option_with` in several placesvarkor-1/+1
2019-12-06Use `to_option` in various placesvarkor-22/+7
2019-12-06Fix Query type docsÖmer Sinan Ağacan-2/+2
`give` no longer exists, `compute` is used to generate query results now.
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-12/+2
2019-12-01rustc_plugin: Remove support for plugin argumentsVadim Petrochenkov-2/+1
2019-11-30pass Queries to compiler callbacksRalf Jung-0/+1
2019-11-29Rollup merge of #66791 - cjgillot:arena, r=Mark-SimulacrumRalf Jung-139/+194
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-27Allocate HIR Forest on arena.Camille GILLOT-3/+1
2019-11-27Misc renames.Camille GILLOT-7/+6
2019-11-27Simplify handling of AllArenas.Camille GILLOT-6/+5
2019-11-27Rename BoxedGlobalCtxt.Camille GILLOT-7/+7
2019-11-27Rename lifetimes.Camille GILLOT-22/+22
2019-11-26Move local Arena to Queries.Camille GILLOT-2/+10
2019-11-26Formatting.Camille GILLOT-37/+35
2019-11-26Have Queries own the GlobalCtxt.Camille GILLOT-53/+56
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-26Review nits.Camille GILLOT-4/+1
2019-11-25Superfluous lifetime.Camille GILLOT-2/+2
2019-11-25Pass Queries by reference.Camille GILLOT-5/+5
2019-11-25Remove wrong comment.Camille GILLOT-5/+0
2019-11-24Tidy.Camille GILLOT-1/+3
2019-11-24Move linking ouside the interface queries.Camille GILLOT-20/+44
2019-11-24Isolate compiler queries inside the Queries type.Camille GILLOT-44/+76
2019-11-24rustc_plugin: Remove support for syntactic pluginsVadim Petrochenkov-21/+8
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-22Auto merge of #66565 - Mark-Simulacrum:syntax-cfg-mod, r=petrochenkovbors-6/+2
Move process_configure_mod to rustc_parse This removes the hack in favor of perhaps a less principled, but less painful, approach. This also supports my work to decouple `Session` from librustc, as `ParseSess` currently has `Attribute` as "part" of it but after this PR will no longer do so.
2019-11-20Delete ProcessCfgModMark Rousskov-6/+2
The previous commit removes the use of this, and now we cleanup.
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-17Rename directory `rustc_plugin` -> `rustc_plugin_impl`Vadim Petrochenkov-1/+1
2019-11-17rustc_plugin: Remove the compatibility shimVadim Petrochenkov-3/+3
2019-11-17Rollup merge of #66456 - Centril:driver-codes, r=Mark-SimulacrumYuki Okushi-28/+14
Move `DIAGNOSTICS` usage to `rustc_driver` Remove `rustc_interface`'s dependency on `rustc_error_codes` and centralize all usages of `DIAGNOSTICS` in `rustc_driver`. Once we remove all references to `rustc_error_codes` in all other crates but `rustc_driver`, this should allow for incremental recompilation of the compiler to be smoother when tweaking error codes. This works towards https://github.com/rust-lang/rust/issues/66210#issuecomment-551862528. (May include traces of minor drive-by cleanup.) r? @Mark-Simulacrum
2019-11-16rustc_plugin: Remove `Registry::register_attribute`Vadim Petrochenkov-8/+1
2019-11-16move DIAGNOSTICS usage to rustc_driverMazdak Farrokhzad-28/+14
2019-11-14Update to use new librustc_error_codes libraryGuillaume Gomez-15/+3
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