about summary refs log tree commit diff
path: root/src/librustc_interface/util.rs
AgeCommit message (Collapse)AuthorLines
2020-02-01pacify the parallel compilerMazdak Farrokhzad-3/+3
2020-02-011. move node_id to syntaxMazdak Farrokhzad-1/+2
2. invert rustc_session & syntax deps 3. drop rustc_session dep in rustc_hir
2020-02-01Move builtin attribute logic to new rustc_attr crate.Mazdak Farrokhzad-2/+2
For now, this is all the crate contains, but more attribute logic & types will be moved there over time.
2020-02-01syntax: move GLOBALS to attr moduleMazdak Farrokhzad-1/+1
2020-01-30Use `P` for `NtTraitItem`, `NtImplItem`, and `NtForeignItem`.Nicholas Nethercote-2/+2
This commit reduces the size of `Nonterminal` from a whopping 240 bytes to 72 bytes (on x86-64), which gets it below the `memcpy` threshold. It also removes some impedance mismatches with `Annotatable`, which already uses `P` for these variants.
2020-01-22Privatize private fields of OutputFilenamesMark Rousskov-19/+14
2020-01-11use winapi for non-stdlib Windows bindingsAndy Russell-8/+6
2020-01-11buffered lint infra -> rustc_sessionMazdak Farrokhzad-5/+7
2020-01-10self-profile: Switch to new approach for event_id generation that enables ↵Michael Woerister-4/+0
query-invocation-specific event_ids.
2020-01-02Normalize `syntax::symbol` imports.Mazdak Farrokhzad-1/+1
2020-01-02Normalize `syntax::source_map` imports.Mazdak Farrokhzad-1/+1
2020-01-01Rename `syntax_pos` to `rustc_span` in source codeVadim Petrochenkov-9/+9
2019-12-25Store callbacks in global staticsMark Rousskov-4/+5
The callbacks have precisely two states: the default, and the one present throughout almost all of the rustc run (the filled in value which has access to TyCtxt). We used to store this as a thread local, and reset it on each thread to the non-default value. But this is somewhat wasteful, since there is no reason to set it globally -- while the callbacks themselves access TLS, they do not do so in a manner that fails in when we do not have TLS to work with.
2019-12-22Format the worldMark Rousskov-107/+90
2019-12-20introduce 'type AttrVec'Mazdak Farrokhzad-4/+3
2019-12-20Rollup merge of #67131 - Centril:item-merge, r=petrochenkovMazdak Farrokhzad-15/+10
Merge `TraitItem` & `ImplItem into `AssocItem` In this PR we: - Merge `{Trait,Impl}Item{Kind?}` into `AssocItem{Kind?}` as discussed in https://github.com/rust-lang/rust/issues/65041#issuecomment-538105286. - This is done by using the cover grammar of both forms. - In particular, it requires that we syntactically allow (under `#[cfg(FALSE)]`): - `default`ness on `trait` items, - `impl` items without a body / definition (`const`, `type`, and `fn`), - and associated `type`s in `impl`s with bounds, e.g., `type Foo: Ord;`. - The syntactic restrictions are replaced by semantic ones in `ast_validation`. - Move syntactic restrictions around C-variadic parameters from the parser into `ast_validation`: - `fn`s in all contexts now syntactically allow `...`, - `...` can occur anywhere in the list syntactically (`fn foo(..., x: usize) {}`), - and `...` can be the sole parameter (`fn foo(...) {}`. r? @petrochenkov
2019-12-12`AssocImplKind::{Method -> Fn}`.Mazdak Farrokhzad-1/+1
2019-12-12Remove `ast::{Impl,Trait}{Item,ItemKind}`.Mazdak Farrokhzad-10/+5
2019-12-12Unify associated item mut visitors.Mazdak Farrokhzad-2/+2
2019-12-12parse: refactor fun ret ty & param tyMazdak Farrokhzad-4/+4
2019-12-11rustc: Link LLVM directly into rustc againAlex Crichton-77/+8
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-06Rename to `then_some` and `then`varkor-2/+2
2019-12-06Use `to_option` in various placesvarkor-10/+2
2019-11-20Delete ProcessCfgModMark Rousskov-2/+0
The previous commit removes the use of this, and now we cleanup.
2019-11-16move DIAGNOSTICS usage to rustc_driverMazdak Farrokhzad-12/+1
2019-11-14Update to use new librustc_error_codes libraryGuillaume Gomez-15/+2
2019-11-12Register queries with self profiler in rustc_interfaceMark Rousskov-0/+4
2019-11-10Auto merge of #65324 - Centril:organize-syntax, r=petrochenkovbors-0/+3
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-0/+1
also move MACRO_ARGUMENTS -> librustc_parse
2019-11-10move config.rs to libsyntax_expandMazdak Farrokhzad-0/+2
2019-11-09Move next_node_id to ResolverMark Rousskov-18/+19
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-03Move crate type checking laterMark Rousskov-50/+59
This allows us to directly pass in a lint buffer
2019-11-03Utilize Resolver lint buffer during HIR loweringMark Rousskov-2/+2
2019-10-17Create lint store during plugin registrationMark Rousskov-7/+0
Remove lint store from Session
2019-10-17De-propagate optional session from lint registrationMark Rousskov-2/+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-07Name the threads in rayon's poolJosh Stone-0/+1
2019-10-07Rebase rustc-rayon on rayon-1.2Josh Stone-4/+4
See also https://github.com/rust-lang/rustc-rayon/pull/3
2019-10-01Rollup merge of #64722 - Mark-Simulacrum:alt-parallel, r=alexcrichtonTyler Mandry-3/+3
Make all alt builders produce parallel-enabled compilers We're not quite ready to ship parallel compilers by default, but the alt builders are not used too much (in theory), so we believe that shipping a possibly-broken compiler there is not too problematic. r? @nikomatsakis
2019-09-30Make the default parallelism 1Mark Rousskov-3/+3
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-09-28Switch over all StableHash impls to new formatMark Rousskov-2/+2
2019-09-26Rename `MetaItem.node` to `MetaItem.kind`varkor-1/+1
2019-09-26Rename `Stmt.node` to `Stmt.kind`varkor-2/+2
2019-09-26Rename `Ty.node` to `Ty.kind`varkor-1/+1
2019-09-26Rename `TraitItem.node` to `TraitItem.kind`varkor-1/+1
2019-09-26Rename `ImplItem.node` to `ImplItem.kind`varkor-1/+1
2019-09-26Rename `Expr.node` to `Expr.kind`varkor-2/+2
For both `ast::Expr` and `hir::Expr`.
2019-09-10Locate rustc binary similarly to codegen backend loadingMark Rousskov-74/+110
This ensures that the failure cases for finding the codegen backend and for finding the rustc binary are essentially the same, and since we almost always will load the codegen backend, this is essentially meaning that the rustc change is not a regression.
2019-09-05Replace diagnostic plugins with macro_rulesMark Rousskov-9/+9