about summary refs log tree commit diff
path: root/src/librustc_interface/passes.rs
AgeCommit message (Collapse)AuthorLines
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
2019-10-04middle::intrinsicck -> rustc_passesMark Rousskov-1/+0
2019-10-04middle::entry -> rustc_passesMark Rousskov-2/+1
2019-10-04middle::dead -> rustc_passesMark Rousskov-1/+1
2019-10-04move middle::liveness to rustc_passesMark Rousskov-1/+0
2019-10-04Rollup merge of #64874 - matthewjasper:simplify-euv, r=eddybMazdak Farrokhzad-2/+1
Simplify ExprUseVisitor * Remove HIR const qualification * Remove parts of ExprUseVisitor that aren't being used r? @eddyb
2019-10-01Rollup merge of #64840 - michaelwoerister:self-profiling-raii-refactor, ↵Tyler Mandry-12/+12
r=wesleywiser SelfProfiler API refactoring and part one of event review This PR refactors the `SelfProfiler` a little bit so that most profiling methods are RAII-based. The codegen backend code already had something similar, this refactoring pulls this functionality up into `SelfProfiler` itself, for general use. The second commit of this PR is a review and update of the existing events we are already recording. Names have been made more consistent. CGU names have been removed from event names. They will be added back in when function parameter recording is implemented. There is still some work to be done for adding new events, especially around trait resolution and the incremental system. r? @wesleywiser
2019-09-30Remove HIR based const qualificationMatthew Jasper-2/+1
2019-09-30Self-Profiling: Make names of existing events more consistent and use new API.Michael Woerister-12/+12
2019-09-30Fixed grammar for some `time` fn calls and a diagnostic.Alexander Regueiro-8/+8
2019-09-28Put panic=abort test support behind -Z panic_abort_testsTyler Mandry-0/+2
2019-09-28Spawn one subprocess per unit test when panic=abortTyler Mandry-0/+1
2019-09-27don't borrowck::check_crate(tcx) anymore.Mazdak Farrokhzad-8/+0
2019-09-25Remove tx_to_llvm_workers from TyCtxtMark Rousskov-5/+1
This can be kept within the codegen backend crates entirely
2019-09-25Rollup merge of #62975 - ljedrz:kill_off_hir_to_node_id, r=ZoxcMazdak Farrokhzad-7/+8
Almost fully deprecate hir::map::Map.hir_to_node_id - HirIdify `doctree::Module.id` - HirIdify `hir::Crate.modules` - introduce a `HirId` to `DefIndex` map in `map::Definitions` The only last uses of `hir::map::Map.hir_to_node_id` in the compiler are: - for the purposes of `driver::pretty` (in `map::nodes_matching_suffix`), but I don't know if we can remove `NodeId`s in there (I think when I attempted it previously there was some issue due to `HirId` not being representable with an integer) - in `ty::query::on_disk_cache` (not sure about the purpose of this one) - in `mir::transform::check_unsafety` (only important for error message order) Any suggestions how to kill these off? r? @Zoxc
2019-09-25Rollup merge of #64324 - alexcrichton:share-generics-again, r=michaelwoeristerMazdak Farrokhzad-4/+0
rustc: Fix mixing crates with different `share_generics` This commit addresses #64319 by removing the `dylib` crate type from the list of crate type that exports generic symbols. The bug in #64319 arises because a `dylib` crate type was trying to export a symbol in an uptream crate but it miscalculated the symbol name of the uptream symbol. This isn't really necessary, though, since `dylib` crates aren't that heavily used, so we can just conservatively say that the `dylib` crate type never exports generic symbols, forcibly removing them from the exported symbol lists if were to otherwise find them. The fix here happens in two places: * First is in the `local_crate_exports_generics` method, indicating that it's now `false` for the `Dylib` crate type. Only rlibs actually export generics at this point. * Next is when we load exported symbols from upstream crate. If, for our compilation session, the crate may be included from a dynamic library, then its generic symbols are removed. When the crate was linked into a dynamic library its symbols weren't exported, so we can't consider them a candidate to link against. Overally this should avoid situations where we incorrectly calculate the upstream symbol names in the face of differnet `share_generics` options, ultimately... Closes #64319
2019-09-24Rollup merge of #64016 - nnethercote:Compiler-fiddling, r=oli-obkMazdak Farrokhzad-4/+0
Streamline `Compiler` A few commits to clean up `Compiler`. r? @Zoxc
2019-09-23rustc: Convert `dependency_formats` to a queryAlex Crichton-4/+0
This commit converts a field of `Session`, `dependency_formats`, into a query of `TyCtxt`. This information then also needed to be threaded through to other remaining portions of the linker, but it's relatively straightforward. The only change here is that instead of `HashMap<CrateType, T>` the data structure changed to `Vec<(CrateType, T)>` to make it easier to deal with in queries.
2019-09-14feature_gate: Remove dead code from attribute checkingVadim Petrochenkov-9/+2
Same checks are performed during name resolution, and all attributes go through name resolution now
2019-09-11Move call site of `dep_graph_future()`.Nicholas Nethercote-4/+0
`Compiler::register_plugins()` calls `passes::register_plugins()`, which calls `Compiler::dep_graph_future()`. This is the only way in which a `passes` function calls a `Compiler` function. This commit moves the `dep_graph_future()` call out of `passes::register_plugins()` and into `Compiler::register_plugins()`, which is a more sensible spot for it. This will delay the loading of the dep graph slightly -- from the middle of plugin registration to the end of plugin registration -- but plugin registration is fast enough (especially compared to expansion) that the impact should be neglible.
2019-09-07Rollup merge of #64139 - Mark-Simulacrum:strip-legacy-proc-macro, r=petrochenkovMazdak Farrokhzad-16/+1
Migrate internal diagnostic registration to macro_rules Review is best done commit-by-commit. Fixes #64132.
2019-09-07Rollup merge of #64243 - petrochenkov:cmdattr, r=alexcrichtonMazdak Farrokhzad-1/+3
Move injection of attributes from command line to `libsyntax_ext` Just a tiny bit of code generation that wasn't moved into `libsyntax_ext` in https://github.com/rust-lang/rust/pull/62771.
2019-09-07Rollup merge of #63919 - matthewjasper:remove-gensymmed, r=petrochenkovMazdak Farrokhzad-11/+16
Use hygiene for AST passes AST passes are now able to have resolve consider their expansions as if they were opaque macros defined either in some module in the current crate, or a fake empty module with `#[no_implicit_prelude]`. * Add an ExpnKind for AST passes. * Remove gensyms in AST passes. * Remove gensyms in`#[test]`, `#[bench]` and `#[test_case]`. * Allow opaque macros to define tests. * Move tests for unit tests to their own directory. * Remove `Ident::{gensym, is_gensymed}` - `Ident::gensym_if_underscore` still exists. cc #60869, #61019 r? @petrochenkov
2019-09-06Move injection of attributes from command line to `libsyntax_ext`Vadim Petrochenkov-1/+3
2019-09-05Simplify std lib injectionMatthew Jasper-1/+1
2019-09-05Remove rustc_diagnostic_macros featureMark Rousskov-4/+0
2019-09-05Replace diagnostic plugins with macro_rulesMark Rousskov-13/+2
2019-09-05Make use of hygiene in AST passesMatthew Jasper-11/+16
2019-08-28Allow running rustdoc on proc-macro crates without specifying '--crate-type ↵Aaron Hill-16/+32
proc-macro' Add a test to make sure that this works
2019-08-25HirIdify hir::Crate.modulesljedrz-7/+8
2019-08-24Improve Rustdoc's handling of procedural macrosAaron Hill-21/+16
Fixes #58700 Fixes #58696 Fixes #49553 Fixes #52210 This commit removes the special rustdoc handling for proc macros, as we can now retrieve their span and attributes just like any other item. A new command-line option is added to rustdoc: `--crate-type`. This takes the same options as rustc's `--crate-type` option. However, all values other than `proc-macro` are treated the same. This allows Rustdoc to enable 'proc macro mode' when handling a proc macro crate. In compiletest, a new 'rustdoc-flags' option is added. This allows us to pass in the '--proc-macro-crate' flag in the absence of Cargo. I've opened [an additional PR to Cargo](https://github.com/rust-lang/cargo/pull/7159) to support passing in this flag. These two PRS can be merged in any order - the Cargo changes will not take effect until the 'cargo' submodule is updated in this repository.
2019-08-10Remove Option from resolverMark Rousskov-9/+9
2019-08-06Don't use remap-path-prefix in dep-info files.Eric Huss-1/+1
2019-07-30Auto merge of #62766 - alexcrichton:stabilize-pipelined-compilation, r=oli-obkbors-2/+2
rustc: Stabilize options for pipelined compilation This commit stabilizes options in the compiler necessary for Cargo to enable "pipelined compilation" by default. The concept of pipelined compilation, how it's implemented, and what it means for rustc are documented in #60988. This PR is coupled with a PR against Cargo (rust-lang/cargo#7143) which updates Cargo's support for pipelined compliation to rustc, and also enables support by default in Cargo. (note that the Cargo PR cannot land until this one against rustc lands). The technical changes performed here were to stabilize the functionality proposed in #60419 and #60987, the underlying pieces to enable pipelined compilation support in Cargo. The issues have had some discussion during stabilization, but the newly stabilized surface area here is: * A new `--json` flag was added to the compiler. * The `--json` flag can be passed multiple times. * The value of the `--json` flag is a comma-separated list of directives. * The `--json` flag cannot be combined with `--color` * The `--json` flag must be combined with `--error-format=json` * The acceptable list of directives to `--json` are: * `diagnostic-short` - the `rendered` field of diagnostics will have a "short" rendering matching `--error-format=short` * `diagnostic-rendered-ansi` - the `rendered` field of diagnostics will be colorized with ansi color codes embedded in the string field * `artifacts` - JSON blobs will be emitted for artifacts being emitted by the compiler The unstable `-Z emit-artifact-notifications` and `--json-rendered` flags have also been removed during this commit as well. Closes #60419 Closes #60987 Closes #60988
2019-07-28Fix `cfg(parallel_compiler)` modeVadim Petrochenkov-1/+0
Fix rebase
2019-07-28Remove lint annotations in specific crates that are already enforced by ↵Vadim Petrochenkov-13/+6
rustbuild Remove some random unnecessary lint `allow`s
2019-07-27syntax_ext: `proc_macro_decls` -> `proc_macro_harness`Vadim Petrochenkov-2/+2
Few other minor renamings for consistency. Remove one unused dependency from `rustc_passes`. Fix libsyntax tests. Fix rebase.
2019-07-27Move standard library injection into libsyntax_extVadim Petrochenkov-1/+6
2019-07-27Move test harness generation into libsyntax_extVadim Petrochenkov-1/+1
2019-07-26rustc: Stabilize options for pipelined compilationAlex Crichton-2/+2
This commit stabilizes options in the compiler necessary for Cargo to enable "pipelined compilation" by default. The concept of pipelined compilation, how it's implemented, and what it means for rustc are documented in #60988. This PR is coupled with a PR against Cargo (rust-lang/cargo#7143) which updates Cargo's support for pipelined compliation to rustc, and also enables support by default in Cargo. (note that the Cargo PR cannot land until this one against rustc lands). The technical changes performed here were to stabilize the functionality proposed in #60419 and #60987, the underlying pieces to enable pipelined compilation support in Cargo. The issues have had some discussion during stabilization, but the newly stabilized surface area here is: * A new `--json` flag was added to the compiler. * The `--json` flag can be passed multiple times. * The value of the `--json` flag is a comma-separated list of directives. * The `--json` flag cannot be combined with `--color` * The `--json` flag must be combined with `--error-format=json` * The acceptable list of directives to `--json` are: * `diagnostic-short` - the `rendered` field of diagnostics will have a "short" rendering matching `--error-format=short` * `diagnostic-rendered-ansi` - the `rendered` field of diagnostics will be colorized with ansi color codes embedded in the string field * `artifacts` - JSON blobs will be emitted for artifacts being emitted by the compiler The unstable `-Z emit-artifact-notifications` and `--json-rendered` flags have also been removed during this commit as well. Closes #60419 Closes #60987 Closes #60988
2019-07-26Introduce built-in macros through libcoreVadim Petrochenkov-1/+4
2019-07-25Rollup merge of #62735 - petrochenkov:galloc, r=alexcrichtonMazdak Farrokhzad-14/+1
Turn `#[global_allocator]` into a regular attribute macro It was a 99% macro with exception of some diagnostic details. As a result of the change, `#[global_allocator]` now works in nested modules and even in nameless blocks. Fixes https://github.com/rust-lang/rust/issues/44113 Fixes https://github.com/rust-lang/rust/issues/58072