summary refs log tree commit diff
path: root/src/librustc_driver
AgeCommit message (Collapse)AuthorLines
2018-03-06incr.comp.: Run cache directory garbage collection before loading dep-graph.Michael Woerister-0/+9
2018-02-10Rollup merge of #47854 - varkor:create-out-dir, r=pnkfelixkennytm-0/+7
Create a directory for --out-dir if it does not already exist Currently if `--out-dir` is set to a non-existent directory, the compiler will throw unfriendly messages like `error: could not write output to subdir/example.crate.allocator.rcgu.o: No such file or directory`, which, while not completely unreadable, isn’t very user-friendly either. This change creates the directory automatically if it does not yet exist.
2018-02-06Auto merge of #47203 - varkor:output-filename-conflicts-with-directory, ↵bors-22/+77
r=estebank Warn when rustc output conflicts with existing directories When the compiled executable would conflict with a directory, display a rustc error instead of a verbose and potentially-confusing linker error. This is a usability improvement, and doesn’t actually change behaviour with regards to compilation success. This addresses the concern in #35887. Fixes #13098.
2018-01-31Auto merge of #47900 - kennytm:rollup, r=kennytmbors-8/+23
Rollup of 16 pull requests - Successful merges: #47838, #47840, #47844, #47874, #47875, #47876, #47884, #47886, #47889, #47890, #47891, #47795, #47677, #47893, #47895, #47552 - Failed merges:
2018-02-01Rollup merge of #47895 - varkor:non-utf-stdin, r=estebankkennytm-7/+22
Fix ICE when reading non-UTF-8 input from stdin Fixes #22387.
2018-01-31rustc: Move location of `codegen-backends` dirAlex Crichton-1/+1
Right now this directory is located under: $sysroot/lib/rustlib/$target/lib/codegen-backends but after seeing what we do in a few other places it seems that a more appropriate location would be: $sysroot/lib/rustlib/$target/codegen-backends so this commit moves it!
2018-01-31Auto merge of #45752 - estebank:highlight-primary, r=nikomatsakisbors-1/+3
Highlight code on diagnostics when underlined Highlight the label's span with the respective color: <img width="692" alt="" src="https://user-images.githubusercontent.com/1606434/32411026-a1842482-c18d-11e7-9933-6510eefbad19.png"> Fix #42112.
2018-01-31Fix ICE when reading non-UTF-8 input from stdinvarkor-7/+22
Fixes #22387.
2018-01-29Toggle span highlighting on `-Zteach`Esteban Küber-1/+3
2018-01-29Create a directory for --out-dir if it does not already existvarkor-0/+7
Currently if `--out-dir` is set to a non-existent directory, the compiler will throw unfriendly messages like `error: could not write output to subdir/example.crate.allocator.rcgu.o: No such file or directory`, which, while not completely unreadable, isn’t very user-friendly either. This change creates the directory automatically if it does not yet exist.
2018-01-29Specify output filenames for compatibility with Windowsvarkor-6/+9
2018-01-29Warn when `-C extra-filename` flag is used with `-o`varkor-0/+3
2018-01-29Minor refactoringvarkor-19/+16
2018-01-29Fix tidy errorvarkor-1/+1
2018-01-29Use correct output file paths for error checkingvarkor-27/+69
2018-01-29Fix quotation markvarkor-1/+1
2018-01-29Fix tidy errorvarkor-1/+2
2018-01-29Warn when rustc output conflicts with existing directoriesvarkor-5/+14
When the compiled executable would conflict with a directory, display a rustc error instead of a verbose and potentially-confusing linker error. This is a usability improvement, and doesn’t actually change behaviour with regards to compilation success. This addresses the concern in #35887.
2018-01-28rustc: Split Emscripten to a separate codegen backendAlex Crichton-15/+14
This commit introduces a separately compiled backend for Emscripten, avoiding compiling the `JSBackend` target in the main LLVM codegen backend. This builds on the foundation provided by #47671 to create a new codegen backend dedicated solely to Emscripten, removing the `JSBackend` of the main codegen backend in the process. A new field was added to each target for this commit which specifies the backend to use for translation, the default being `llvm` which is the main backend that we use. The Emscripten targets specify an `emscripten` backend instead of the main `llvm` one. There's a whole bunch of consequences of this change, but I'll try to enumerate them here: * A *second* LLVM submodule was added in this commit. The main LLVM submodule will soon start to drift from the Emscripten submodule, but currently they're both at the same revision. * Logic was added to rustbuild to *not* build the Emscripten backend by default. This is gated behind a `--enable-emscripten` flag to the configure script. By default users should neither check out the emscripten submodule nor compile it. * The `init_repo.sh` script was updated to fetch the Emscripten submodule from GitHub the same way we do the main LLVM submodule (a tarball fetch). * The Emscripten backend, turned off by default, is still turned on for a number of targets on CI. We'll only be shipping an Emscripten backend with Tier 1 platforms, though. All cross-compiled platforms will not be receiving an Emscripten backend yet. This commit means that when you download the `rustc` package in Rustup for Tier 1 platforms you'll be receiving two trans backends, one for Emscripten and one that's the general LLVM backend. If you never compile for Emscripten you'll never use the Emscripten backend, so we may update this one day to only download the Emscripten backend when you add the Emscripten target. For now though it's just an extra 10MB gzip'd. Closes #46819
2018-01-27rustc: Load the `rustc_trans` crate at runtimeAlex Crichton-55/+247
Building on the work of # 45684 this commit updates the compiler to unconditionally load the `rustc_trans` crate at runtime instead of linking to it at compile time. The end goal of this work is to implement # 46819 where rustc will have multiple backends available to it to load. This commit starts off by removing the `extern crate rustc_trans` from the driver. This involved moving some miscellaneous functionality into the `TransCrate` trait and also required an implementation of how to locate and load the trans backend. This ended up being a little tricky because the sysroot isn't always the right location (for example `--sysroot` arguments) so some extra code was added as well to probe a directory relative to the current dll (the rustc_driver dll). Rustbuild has been updated accordingly as well to have a separate compilation invocation for the `rustc_trans` crate and assembly it accordingly into the sysroot. Finally, the distribution logic for the `rustc` package was also updated to slurp up the trans backends folder. A number of assorted fallout changes were included here as well to ensure tests pass and such, and they should all be commented inline.
2018-01-26Do not capture stderr in the compiler. Instead just panic silently for fatal ↵John Kåre Alsaker-28/+7
errors
2018-01-25Rollup merge of #47679 - etaoins:remove-redundant-backtrace-hint, r=estebankGuillaume Gomez-8/+0
Remove broken redundant backtrace hint When the compiler driver panics it attempts to show a hint about using `RUST_BACKTRACE`. However, the logic is currently reversed to the hint is only shown if `RUST_BACKTRACE` is **already** set: ```shell > RUST_BACKTRACE=1 rustc /dev/null --crate-type proc-macro error: internal compiler error: unexpected panic ... note: run with `RUST_BACKTRACE=1` for a backtrace thread 'rustc' panicked at 'attempt to subtract with overflow', librustc_errors/emitter.rs:287:49 note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. > RUST_BACKTRACE=0 rustc /dev/null --crate-type proc-macro error: internal compiler error: unexpected panic ... thread 'rustc' panicked at 'attempt to subtract with overflow', librustc_errors/emitter.rs:287:49 note: Run with `RUST_BACKTRACE=1` for a backtrace. ``` As the `panic` itself already has a working `RUST_BACKTRACE` hint just remove the broken duplicate hint entirely.
2018-01-23Auto merge of #47678 - kennytm:rollup, r=kennytmbors-45/+29
Rollup of 14 pull requests - Successful merges: #47423, #47425, #47440, #47541, #47549, #47554, #47558, #47610, #47635, #47655, #47661, #47662, #47667, #47672 - Failed merges:
2018-01-23Rollup merge of #47661 - bjorn3:refactor_driver, r=michaelwoeristerkennytm-39/+22
Inline some rustc_driver function
2018-01-23Remove broken redundant backtrace hintRyan Cumming-8/+0
When the compiler driver panics it attempts to show a hint about using `RUST_BACKTRACE`. However, the logic is currently reversed to the hint is only shown if `RUST_BACKTRACE` is *already* set: ```shell > RUST_BACKTRACE=1 rustc /dev/null --crate-type proc-macro error: internal compiler error: unexpected panic ... note: run with `RUST_BACKTRACE=1` for a backtrace thread 'rustc' panicked at 'attempt to subtract with overflow', librustc_errors/emitter.rs:287:49 note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. > RUST_BACKTRACE=0 rustc /dev/null --crate-type proc-macro error: internal compiler error: unexpected panic ... thread 'rustc' panicked at 'attempt to subtract with overflow', librustc_errors/emitter.rs:287:49 note: Run with `RUST_BACKTRACE=1` for a backtrace. ``` As the `panic` itself already has a working `RUST_BACKTRACE` hint just remove the broken duplicate hint entirely.
2018-01-23Rollup merge of #47440 - mark-i-m:zunpretty, r=nikomatsakiskennytm-6/+7
Change the --unpretty flag to -Z unpretty First PR :smile: ! -Z unpretty no longer requires -Z unstable-options. Also, I mildly changed the syntax of the flag to match the other -Z flags. All uses of the flag take the form `unpretty=something` where something can either `string` or `string=string` (see the help messages of the CLI). Fix #47395 r? @nikomatsakis EDIT: apparently rust-highfive doesn't see edits...
2018-01-22Inline some rustc_driver functionbjorn3-39/+22
2018-01-22cleanupQuietMisdreavus-4/+5
2018-01-22Split out creation of the resolver arena in phase_2_configure_and_expandManish Goregaokar-24/+55
2018-01-22Move resolve arenas/crate loader outside of the core of ↵Manish Goregaokar-11/+16
phase_2_configure_and_expand
2018-01-19Just forget the DynamicLibrary after getting a hot plugged backendbjorn3-59/+2
2018-01-19Fix hotplug backend and add testbjorn3-0/+8
2018-01-19Fix review commentsbjorn3-3/+78
2018-01-19Cleanup hot plug codegen backend codebjorn3-1/+1
2018-01-19Hot plug rustc_transbjorn3-0/+3
2018-01-19Fix rustc_driver test.rsbjorn3-1/+0
2018-01-19Fix rustc_driver test.rsbjorn3-3/+1
2018-01-19Allow runtime switching between trans backendsbjorn3-184/+94
2018-01-18Change the --unpretty flag to -Z unprettyMark Mansi-6/+7
-Z unpretty no longer requires -Z unstable-options. Also, I mildly changed the syntax of the flag to match the other -Z flags. All uses of the flag take the form `unpretty=something` where something can either `string` or `string=string` (see the help messages of the CLI).
2018-01-15Add `-Z dep-info-omit-d-target` to control dep-info styleAdam C. Foltzer-2/+3
This avoids a breaking change to dep-info output, putting the gcc/clang-compliant dep-info behavior behind a flag
2018-01-15remove dep-info files as targets in themselvesAdam C. Foltzer-0/+2
2018-01-15Rollup merge of #47417 - petrochenkov:noasm, r=estebankkennytm-5/+1
Move "no asm" check into AST validation
2018-01-14Auto merge of #47223 - alexcrichton:new-target-feature, r=eddybbors-4/+4
rustc: Tweak `#[target_feature]` syntax This is an implementation of the `#[target_feature]` syntax-related changes of [RFC 2045][rfc]. Notably two changes have been implemented: * The new syntax is `#[target_feature(enable = "..")]` instead of `#[target_feature = "+.."]`. The `enable` key is necessary instead of the `+` to indicate that a feature is being enabled, and a sub-list is used for possible expansion in the future. Additionally within this syntax the feature names being enabled are now whitelisted against a known set of target feature names that we know about. * The `#[target_feature]` attribute can only be applied to unsafe functions. It was decided in the RFC that invoking an instruction possibly not defined for the current processor is undefined behavior, so to enable this feature for now it requires an `unsafe` intervention. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/2045-target-feature.md
2018-01-13rustc: Refactor attribute checking to operate on HIRAlex Crichton-4/+4
This'll enable running queries that could be cached and overall be more amenable to the query infastructure.
2018-01-13Move "no asm" check into AST validationVadim Petrochenkov-5/+1
2018-01-13Remove `impl Foo for ..` in favor of `auto trait Foo`leonardo.yvens-2/+1
No longer parse it. Remove AutoTrait variant from AST and HIR. Remove backwards compatibility lint. Remove coherence checks, they make no sense for the new syntax. Remove from rustdoc.
2018-01-13Rollup merge of #47331 - michaelwoerister:measure-depgraph-loading, ↵kennytm-4/+5
r=alexcrichton Add -Ztime-passes line for dep-graph loading. We measure how much time the background thread spends on loading the dep-graph but not how long the main thread is blocked while the background thread is still working. Let's change that!
2018-01-10Add -Ztime-passes line for dep-graph loading.Michael Woerister-4/+5
2018-01-09Replace uses of DepGraph.in_ignore with DepGraph.with_ignoreJohn Kåre Alsaker-15/+16
2018-01-09Rollup merge of #47233 - dotdash:cleanup_llvm, r=alexcrichtonkennytm-5/+0
Remove unused LLVM related code Ticks a few more boxes on #46437