about summary refs log tree commit diff
path: root/src/librustc_driver
AgeCommit message (Collapse)AuthorLines
2016-05-03rebasingNick Cameron-7/+1
Note that this whole PR is a [breaking-change] for clients of the Compiler API.
2016-05-03Fix testsNick Cameron-2/+7
2016-05-03Refactor pretty printing to use more of the driverNick Cameron-263/+330
2016-05-03Use the compiler API to run pretty printing.Nick Cameron-79/+79
This commit still does a lot of building in pretty because we always run after parsing.
2016-05-03Make pretty printer take Session by refNick Cameron-21/+21
2016-05-02patch travis failureNiko Matsakis-1/+2
2016-05-02fix rebase flawsNiko Matsakis-3/+2
2016-05-02fix error message in librustc_driver testsNiko Matsakis-1/+2
2016-05-02refactor the Emitter traitNiko Matsakis-8/+9
There is now a CoreEmitter that everything desugars to, but without losing any information. Also remove RenderSpan::FileLine. This lets the rustc_driver tests build.
2016-05-02refactor to use new snippet code and modelNiko Matsakis-11/+9
Major changes: - Remove old snippet rendering code and use the new stuff. - Introduce `span_label` method to add a label - Remove EndSpan mode and replace with a fn to get the last character of a span. - Stop using `Option<MultiSpan>` and just use an empty `MultiSpan` - and probably a bunch of other stuff :)
2016-05-01Auto merge of #33296 - jseyfried:non_idempotent_lowering, r=nrcbors-14/+3
Remove the requirement that ast->hir lowering be reproducible This PR changes the ast->hir lowerer to be non-reproducible, and it removes the lowering context's id cache. If the `hir` of an `ast` node needs to be reproduced, we can use the hir map instead of the lowerer -- for example, `tcx.map.expect_expr(expr.id)` instead of `lower_expr(lcx, expr)`. r? @nrc
2016-05-02Avoid keeping MTWT tables for save-analysisJeffrey Seyfried-3/+1
2016-05-01Avoid using the lowering context in `librustc_save_analysis`Jeffrey Seyfried-11/+2
2016-05-01Remove rust flags from doc blockGuillaume Gomez-1/+7
2016-04-30Auto merge of #32846 - jseyfried:allow_unconfigured_gated_expanded_items, r=nrcbors-19/+2
Avoid gated feature checking unconfigured expanded items Avoid gated feature checking unconfigured macro-expanded items (fixes #32840). Unconfigured items that are not macro-expanded are already not gated feature checked. r? @nrc
2016-04-28Auto merge of #33217 - aochagavia:fileloader, r=nrcbors-9/+21
rustc_driver: Allow running the compiler with a FileLoader cc @nrc. I chose to implement this in such a way that it doesn't break anything. Please let me know if you want me to change anything.
2016-04-28Auto merge of #33208 - nrc:save-json, r=pnkfelixbors-6/+32
save-analysis: dump in JSON format cc #18582
2016-04-27Auto merge of #32791 - LeoTestard:feature-gate-clean, r=nikomatsakisbors-11/+5
Feature gate clean This PR does a bit of cleaning in the feature-gate-handling code of libsyntax. It also fixes two bugs (#32782 and #32648). Changes include: * Change the way the existing features are declared in `feature_gate.rs`. The array of features and the `Features` struct are now defined together by a single macro. `featureck.py` has been updated accordingly. Note: there are now three different arrays for active, removed and accepted features instead of a single one with a `Status` item to tell wether a feature is active, removed, or accepted. This is mainly due to the way I implemented my macro in the first time and I can switch back to a single array if needed. But an advantage of the way it is now is that when an active feature is used, the parser only searches through the list of active features. It goes through the other arrays only if the feature is not found. I like to think that error checking (in this case, checking that an used feature is active) does not slow down compilation of valid code. :) But this is not very important... * Feature-gate checking pass now use the `Features` structure instead of looking through a string vector. This should speed them up a bit. The construction of the `Features` struct should be faster too since it is build directly when parsing features instead of calling `has_feature` dozens of times. * The MacroVisitor pass has been removed, it was mostly useless since the `#[cfg]-stripping` phase happens before (fixes #32648). The features that must actually be checked before expansion are now checked at the time they are used. This also allows us to check attributes that are generated by macro expansion and not visible to MacroVisitor, but are also removed by macro expansion and thus not visible to PostExpansionVisitor either. This fixes #32782. Note that in order for `#[derive_*]` to be feature-gated but still accepted when generated by `#[derive(Trait)]`, I had to do a little bit of trickery with spans that I'm not totally confident into. Please review that part carefully. (It's in `libsyntax_ext/deriving/mod.rs`.):: Note: this is a [breaking change], since programs with feature-gated attributes on macro-generated macro invocations were not rejected before. For example: ```rust macro_rules! bar ( () => () ); macro_rules! foo ( () => ( #[allow_internal_unstable] //~ ERROR allow_internal_unstable side-steps bar!(); ); ); ``` foo!();
2016-04-27rustc_driver: Allow running the compiler with a FileLoaderAdolfo Ochagavía-9/+21
2016-04-26save-analysis-json: thread through -z optionNick Cameron-6/+32
In fact, we make JSOn the default and add an option for save-analysis-csv for the legacy behaviour. We also rename some bits and pieces `dxr` -> `save-analysis`
2016-04-22Auto merge of #33089 - nrc:hir-name-res, r=eddybbors-48/+49
Move def id collection and extern crate handling to before AST->HIR lowering r? @jseyfried, @eddyb, or @nikomatsakis
2016-04-22Remove the MacroVisitor pass.Leo Testard-11/+5
This pass was supposed to check use of gated features before `#[cfg]`-stripping but this was not the case since it in fact happens after. Checks that are actually important and must be done before macro expansion are now made where the features are actually used. Close #32648. Also ensure that attributes on macro-generated macro invocations are checked as well. Close #32782 and #32655.
2016-04-20Auto merge of #31709 - ranma42:target_feature-from-llvm, r=alexcrichtonbors-65/+40
Compute `target_feature` from LLVM This is a work-in-progress fix for #31662. The logic that computes the target features from the command line has been replaced with queries to the `TargetMachine`.
2016-04-20Check that the feature strings are well-formedAndrea Canciani-0/+1
Assert that the feature strings are NUL terminated, so that they will be well-formed as C strings. This is a safety check to ease the maintaninace and update of the feature lists.
2016-04-20Make the feature whitelists constantsAndrea Canciani-25/+25
This simplifies the code a bit and makes the types nicer, too.
2016-04-20rebasingNick Cameron-1/+1
2016-04-20debugging, misc fixesNick Cameron-23/+28
2016-04-20def_collector and crate reader operate on AST instead of HIRNick Cameron-37/+27
And move extern crate reading earlier in the driver
2016-04-20Separate def collection and hir map making even furtherNick Cameron-11/+12
2016-04-20Move DefCollector to its own module.Nick Cameron-1/+1
2016-04-20Split up NodeCollector so that defs are collected separately from nodes for ↵Nick Cameron-16/+21
the HIR map.
2016-04-20Trivial refactoringNick Cameron-7/+7
2016-04-19Distinguish different `vfp?` featuresAndrea Canciani-1/+7
The different generations of ARM floating point VFP correspond to the LLVM CPU features named `vfp2`, `vfp3`, and `vfp4`; they are now exposed in Rust under the same names. This commit fixes some crashes that would occour when checking if the `vfp` feature exists (the crash occurs because the linear scan of the LLVM feature goes past the end of the features whenever it searches for a feature that does not exist in the LLVM tables).
2016-04-19Do not intern NUL terminatorsAndrea Canciani-1/+1
The C representation needed by LLVM requires strings to be NUL-terminated, but on the Rust side they should not contain unwanted NULs.
2016-04-12Auto merge of #32811 - alexcrichton:check-lints, r=nrcbors-1/+1
rustdoc: Fix testing no_run code blocks This was a regression introduced by #31250 where the compiler deferred returning the results of compilation a little too late (after the `Stop` check was looked at). This commit alters the stop point to first try to return an erroneous `result` and only if it was successful return the sentinel `Err(0)`. Closes #31576
2016-04-11rustdoc: Fix testing no_run code blocksAlex Crichton-1/+1
This was a regression introduced by #31250 where the compiler deferred returning the results of compilation a little too late (after the `Stop` check was looked at). This commit alters the stop point to first try to return an erroneous `result` and only if it was successful return the sentinel `Err(0)`. Closes #31576
2016-04-09Remove redundant gated feature checking passJeffrey Seyfried-17/+2
2016-04-08Avoid gated feature checking unconfigured itemsJeffrey Seyfried-15/+13
2016-04-09Expose the features computed from LLVM in `cfg!`Andrea Canciani-63/+31
Instead of relying on the features explicitly passed through the command line, compute them from the LLVM `TargetMachine`.
2016-04-07Auto merge of #32016 - nikomatsakis:incr-comp-save, r=mwbors-3/+21
Save/load incremental compilation dep graph Contains the code to serialize/deserialize the dep graph to disk between executions. We also hash the item contents and compare to the new hashes. Also includes a unit test harness. There are definitely some known limitations, such as https://github.com/rust-lang/rust/issues/32014 and https://github.com/rust-lang/rust/issues/32015, but I am leaving those for follow-up work. Note that this PR builds on https://github.com/rust-lang/rust/pull/32007, so the overlapping commits can be excluded from review. r? @michaelwoerister
2016-04-06Auto merge of #32230 - GuillaumeGomez:extend_css, r=alexcrichtonbors-49/+4
Add --extend-css option to rustdoc Fixes #32223 r? @brson
2016-04-06add code to persist graph and for unit-testingNiko Matsakis-0/+8
2016-04-06make an incremental crateNiko Matsakis-2/+12
for now, this houses `svh` and the code to check `assert_dep_graph` is sane
2016-04-06restructure rustc options relating to incr. comp.Niko Matsakis-1/+1
You can now pass `-Z incremental=dir` as well as saying `-Z query-dep-graph` if you want to enable queries for some other purpose. Accessor functions take the place of computed boolean flags.
2016-04-06rustc: retire hir::map's paths.Eduard Burtescu-2/+17
2016-04-06rustc: move rustc_front to rustc::hir.Eduard Burtescu-15/+12
2016-04-05Rollup merge of #32596 - soltanmm:lazy, r=nikomatsakisManish Goregaokar-8/+17
Plumb obligations through librustc/infer Like #32542, but more like #31867. TODO before merge: make an issue for the propagation of obligations through... uh, everywhere... then replace the `#????`s with the actual issue number. cc @jroesch r? @nikomatsakis
2016-04-05Centralize nightly compiler flags handlingGuillaume Gomez-49/+4
2016-04-04Address nitsMasood Malekghassemi-3/+3
2016-04-03Auto merge of #32210 - Aatch:mir-traversal, r=nikomatsakisbors-7/+13
rBreak Critical Edges and other MIR work This PR is built on top of #32080. This adds the basic depth-first traversals for MIR, preorder, postorder and reverse postorder. The MIR blocks are now translated using reverse postorder. There is also a transform for breaking critical edges, which includes the edges from `invoke`d calls (`Drop` and `Call`), to account for the fact that we can't add code after an `invoke`. It also stops generating the intermediate block (since the transform essentially does it if necessary already). The kinds of cases this deals with are difficult to produce, so the test is the one I managed to get. However, it seems to bootstrap with `-Z orbit`, which it didn't before my changes.