about summary refs log tree commit diff
path: root/src/librustc/session
AgeCommit message (Collapse)AuthorLines
2019-12-03Move Session to librustc_sessionMark Rousskov-4718/+0
2019-12-03Duplicate CrateConfig into SessionMark Rousskov-1/+3
Since it's just a type alias this isn't too difficult and once Session is moved back we can make this be the canonical location.
2019-12-03Directly use types from libsyntax::astMark Rousskov-5/+4
2019-12-03Re-export Client from rustc_data_structures::jobserverMark Rousskov-2/+1
2019-12-03Move NativeLibraryKind to rustc_sessionMark Rousskov-12/+15
2019-12-03Move early lint declarations to librustc_sessionMark Rousskov-2/+2
2019-12-03Move Lint to rustc_sessionMark Rousskov-1/+1
This commit breaks early-lint registration, which will be fixed in the next commit. This movement will allow essentially all crates in the compiler tree to declare lints (though not lint passes).
2019-12-03Move cgu_reuse_tracker to librustc_sessionMark Rousskov-1/+1
2019-12-03Use FxHash* from data structures not nodemapMark Rousskov-1/+1
2019-12-02Rollup merge of #66245 - tmiasko:cfg-sanitize, r=oli-obkRalf Jung-0/+15
Conditional compilation for sanitizers Configure sanitize option when compiling with a sanitizer to make it possible to execute different code depending on whether given sanitizer is enabled or not.
2019-12-01rustc_plugin: Remove support for plugins adding LLVM passesVadim Petrochenkov-2/+0
2019-12-01rustc_plugin: Remove support for adding plugins from command lineVadim Petrochenkov-2/+0
2019-12-01Conditional compilation for sanitizersTomasz Miąsko-0/+15
Configure sanitize option when compiling with a sanitizer to make it possible to execute different code depending on whether given sanitizer is enabled or not.
2019-12-01Rollup merge of #66726 - CAD97:miri-recursion-limit, r=RalfJungMazdak Farrokhzad-4/+0
Use recursion_limit for const eval stack limit cc https://github.com/rust-lang/miri/issues/643 @orium @RalfJung I'm really not certain how exactly to handle this change, but it looks like it's that simple. Reuse `recursion_limit` ("The maximum recursion limit for potentially infinitely recursive operations such as auto-dereference and monomorphization") which is configurable by the user for the const evaluation stack frame limit. The other option is to make `const_eval_stack_frame_limit` configurable in the same way as `recursion_limit` (but I'm not sure how to do that and it'd be a bigger change). Fixes https://github.com/rust-lang/miri/issues/643.
2019-11-30Rollup merge of #66895 - Centril:rustc_feature, r=oli-obkMazdak Farrokhzad-7/+6
Feature gating *declarations* => new crate `rustc_feature` This PR moves the data-oriented parts of feature gating into its own crate, `rustc_feature`. The parts consist of some data types as well as `accepted`, `active`, `removed`, and `builtin_attrs`. Feature gate checking itself remains in `syntax::feature_gate::check`. The parts which define how to emit feature gate errors could probably be moved to `rustc_errors` or to the new `rustc_session` crate introduced in #66878. The visitor itself could probably be moved as a pass in `rustc_passes` depending on how the dependency edges work out. The PR also contains some drive-by cleanup of feature gate checking. As such, the PR probably best read commit-by-commit. r? @oli-obk cc @petrochenkov cc @Mark-Simulacrum
2019-11-29Use recursion_limit for const eval stack limitcad97-4/+0
2019-11-30move UnstableFeatures -> rustc_featureMazdak Farrokhzad-3/+3
2019-11-30introduce crate rustc_feature and move active, accepted, and removed to itMazdak Farrokhzad-4/+3
2019-11-28rustc_metadata: Move `has_global_allocator` from session to cstoreVadim Petrochenkov-4/+0
2019-11-26Rollup merge of #66719 - Mark-Simulacrum:int-normalization, r=CentrilTyler Mandry-9/+7
Store pointer width as u32 on Config This removes the dependency on IntTy, UintTy from Session. It's not obviously a win, but it seems a bit odd to store the AST IntTy/UintTy in Session, rather we store the pointer width as an integer and add normalization methods to IntTy and UintTy.
2019-11-26Auto merge of #66522 - tmiasko:sanitize-flags, r=alexcrichtonbors-9/+61
Add support for sanitizer recover and tracking origins of uninitialized memory * Add support for sanitizer recovery `-Zsanitizer-recover=...` (equivalent to `-fsanitize-recover` in clang). * Add support for tracking origins of uninitialized memory in MemorySanitizer `-Zsanitizer-memory-track-origins` (equivalent to `-fsanitize-memory-track-origins` in clang).
2019-11-24Store ptr_width as u32 on ConfigMark Rousskov-9/+7
This removes the dependency on IntTy, UintTy from Session.
2019-11-22Rollup merge of #66575 - Mark-Simulacrum:no-uii, r=petrochenkovMazdak Farrokhzad-110/+7
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-22Add support for tracking origins of uninitialized memoryTomasz Miąsko-0/+19
2019-11-22Add support for sanitizer recoveryTomasz Miąsko-9/+42
2019-11-22Auto merge of #66565 - Mark-Simulacrum:syntax-cfg-mod, r=petrochenkovbors-7/+1
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-21Aggregation of drive-by cosmetic changes.Alexander Regueiro-1/+1
2019-11-20Delete ProcessCfgModMark Rousskov-7/+1
The previous commit removes the use of this, and now we cleanup.
2019-11-20Remove pretty printing of specific nodes in ASTMark Rousskov-110/+7
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-19Mark -Zgenerate-arange-section as TRACKEDJosh Stone-1/+1
2019-11-18Generate DWARF address ranges for faster lookupsJosh Stone-0/+2
This adds a new option `-Zgenerate-arange-section`, enabled by default, corresponding to LLVM's `-generate-arange-section`. This creates a `.debug_aranges` section with DWARF address ranges, which some tools depend on to optimize address lookups (elfutils [22288], [25173]). This only has effect when debuginfo is enabled, and the additional data is small compared to the other debug sections. For example, libstd.so with full debuginfo is about 11MB, with just 61kB in aranges. [22288]: https://sourceware.org/bugzilla/show_bug.cgi?id=22288 [25173]: https://sourceware.org/bugzilla/show_bug.cgi?id=25173 Closes #45246.
2019-11-17Auto merge of #66385 - ecstatic-morse:check-only-pass2, r=eddybbors-2/+0
Make dataflow-based const qualification the canonical one For over a month, dataflow-based const qualification has been running in parallel with `qualify_consts` to check the bodies of `const` and `static`s. This PR removes the old qualification pass completely in favor of the dataflow-based one. **edit:** This PR also stops checking `QUALIF_ERROR_BIT` during promotion. This check appears to no longer serve a purpose now that the CTFE engine is more robust. As a side-effect, this resolves #66167. r? @eddyb
2019-11-17Rollup merge of #66456 - Centril:driver-codes, r=Mark-SimulacrumYuki Okushi-5/+4
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-4/+1
2019-11-16move DIAGNOSTICS usage to rustc_driverMazdak Farrokhzad-5/+4
2019-11-15Remove -Z flag for suppressing validation mismatch ICEDylan MacKenzie-2/+0
2019-11-15Move JSON emitter to rustc_errorsMark Rousskov-1/+1
2019-11-13Rollup merge of #66335 - Mark-Simulacrum:self-profile-to-data, ↵Yuki Okushi-2/+1
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-13Rollup merge of #66334 - Mark-Simulacrum:sess-cstore, r=petrochenkovYuki Okushi-10/+0
Move Session fields to CrateStore `allocator_kind` and `injected_panic_runtime` are both query-like, this moves them out of Session and into CrateStore, avoiding the `Once` they previously had by clearing separating initialization and de-initialization.
2019-11-12Register queries with self profiler in rustc_interfaceMark Rousskov-1/+0
2019-11-12Move self-profile infrastructure to data structuresMark Rousskov-1/+1
The single dependency on queries (QueryName) can be fairly easily abstracted via a trait and this further decouples Session from librustc (the primary goal).
2019-11-12Rollup merge of #66299 - rossmacarthur:fix-41260-avoid-issue-0, r=varkorYuki Okushi-1/+2
support issue = "none" in unstable attributes This works towards fixing #41260. This PR allows the use of `issue = "none"` in unstable attributes and makes changes to internally store the issue number as an `Option<NonZeroU32>`. For example: ```rust #[unstable(feature = "unstable_test_feature", issue = "none")] fn unstable_issue_none() {} ``` It was not made optional because feedback seen here #60860 suggested that people might forget the issue field if it was optional. I could not remove the current uses of `issue = "0"` (of which there are a lot) because the stage 0 compiler expects the old syntax. Once this is available in the stage 0 compiler we can replace all uses of `"0"` with `"none"` and no longer allow `"0"`. This is my first time contributing, so I'm not sure what the protocol is with two-part things like this, so some guidance would be appreciated. r? @varkor
2019-11-12Rollup merge of #66276 - Mark-Simulacrum:sess-code-stats, r=nikomatsakisYuki Okushi-6/+8
Move lock into CodeStats Prevent (theoretical) accidental too-long borrows by ensuring only encapsulated locking.
2019-11-11Move allocator_kind to CrateStoreMark Rousskov-7/+0
Similarly to the previous commit, there's no need for this to be in Session and have a Once around it.
2019-11-11Move injected_panic_runtime to CrateStoreMark Rousskov-3/+0
This was essentially a "query" previously (with no key, just always run once when resolving the crate dependencies), and remains so, just now in a way that isn't on Session. This removes the need for the `Once` as well.
2019-11-11support issue = "none" in unstable attributesRoss MacArthur-1/+2
- Use `Option<NonZeroU32>` to represent issue numbers.
2019-11-10Move lock into CodeStatsMark Rousskov-6/+8
Prevent accidental too-long borrows by ensuring only encapsulated locking.
2019-11-10Auto merge of #65324 - Centril:organize-syntax, r=petrochenkovbors-2/+14
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 config.rs to libsyntax_expandMazdak Farrokhzad-2/+14
2019-11-09Move pretty parsing into Session optionsMark Rousskov-0/+220
This allows us to query whether PpmEveryBodyLoops is set during expansion and run the everybody loops pass.