about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm
AgeCommit message (Collapse)AuthorLines
2020-02-12Rollup merge of #68487 - 0dvictor:nolink, r=tmandryYuki Okushi-2/+2
[experiment] Support linking from a .rlink file Flag `-Z no-link` was previously introduced, which allows creating an `.rlink` file to perform compilation without linking. This change enables linking from an `.rlink` file. Part of Issue #64191
2020-02-11Rollup merge of #66498 - bjorn3:less_feature_flags, r=Dylan-DPCDylan DPC-18/+13
Remove unused feature gates I think many of the remaining unstable things can be easily be replaced with stable things. I have kept the `#![feature(nll)]` even though it is only necessary in `libstd`, to make regressions of it harder.
2020-02-11Support linking from a .rlink fileVictor Ding-2/+2
Flag `-Z no-link` was previously introduced, which allows creating an `.rlink` file to perform compilation without linking. This change enables linking from an `.rlink` file.
2020-02-10Rollup merge of #68932 - ↵Dylan DPC-57/+69
michaelwoerister:self-profile-generic-activity-args, r=wesleywiser self-profile: Support arguments for generic_activities. This PR adds support for recording arguments of "generic activities". The most notable use case is LLVM module names, which should be very interesting for `crox` profiles. In the future it might be interesting to add more fine-grained events for pre-query passes like macro expansion. I tried to judiciously de-duplicate existing self-profile events with `extra_verbose_generic_activity`, now that the latter also generates self-profile events. r? @wesleywiser
2020-02-10self-profile: Support arguments for generic_activities.Michael Woerister-57/+69
2020-02-09Rollup merge of #68881 - eddyb:always-preserve-dbg-vars, r=nagisaJonas Schievink-1/+1
rustc_codegen_llvm: always set AlwaysPreserve on all debuginfo variables Making this depend on the optimization level appears to have been a copy-paste mistake (other LLVM functions called in this module also take a `bool` argument, but there it means something unrelated). Also see https://github.com/rust-lang/rust/pull/8855#discussion_r374392128. I don't believe we have any reason to let LLVM omit user variables from DWARF, and we were already setting this to `true` when LLVM *could* optimize them away, so this PR should have no effect anyway. r? @michaelwoerister or @nagisa cc @hanna-kruppe @nikomatsakis
2020-02-08rustc_codegen_ssa: remove unnecessary source_locations_enabled.Eduard-Mihai Burtescu-34/+9
2020-02-08rustc_codegen_llvm: remove InternalDebugLocation and simplify dbg_var_addr.Eduard-Mihai Burtescu-66/+35
2020-02-08rustc_codegen_llvm: remove unnecessary special-casing of root scopes' children.Eduard-Mihai Burtescu-8/+2
2020-02-07Rustfmtbjorn3-7/+9
2020-02-06rustc_codegen_llvm: always set AlwaysPreserve on all debuginfo variables.Eduard-Mihai Burtescu-1/+1
2020-02-05Apply LLVM sanitize attributes to generated entry wrapperTomasz Miąsko-22/+31
2020-02-05Selectively disable sanitizer instrumentationTomasz Miąsko-16/+20
Add `no_sanitize` attribute that allows to opt out from sanitizer instrumentation in an annotated function.
2020-02-04Remove unused feature gates from cg_llvmbjorn3-13/+6
Also turns a few `box` into `Box::new`
2020-02-04Auto merge of #68601 - 0dvictor:split, r=tmandrybors-13/+16
Split `join_codegen_and_link()` into two steps `join_codegen_and_link()` is split to `join_codegen()` and `link()`.
2020-02-04Split `join_codegen_and_link()` into two stepsVictor Ding-13/+16
`join_codegen_and_link()` is split to `join_codegen()` and `link()`.
2020-02-03rustc_codegen_llvm: avoid redundant calls to span_start.Eduard-Mihai Burtescu-4/+4
2020-02-03rustc_codegen_ssa: split declare_local into create_dbg_var and dbg_var_addr.Eduard-Mihai Burtescu-33/+53
2020-02-02Auto merge of #68720 - wesleywiser:llvm_time_trace, r=davidtwcobors-0/+28
Add support for enabling the LLVM time-trace feature I found this helpful while investigating an LLVM performance issue. Passing `-Z llvm-time-trace` causes a `llvm_timings.json` file to be created. This file can be inspected in with the Chrome Profiler tools or with any other compatible tool like SpeedScope. More information on the LLVM feature: - https://aras-p.info/blog/2019/01/16/time-trace-timeline-flame-chart-profiler-for-Clang/ - https://reviews.llvm.org/rL357340
2020-02-01Add support for enabling the LLVM time-trace featureWesley Wiser-0/+28
I found this helpful while investigating an LLVM performance issue. Passing `-Z llvm-time-trace` causes a `llvm_timings.json` file to be created. This file can be inspected in either the Chrome Profiler tools or with any other compatible tool like SpeedScope. More information on the LLVM feature: - https://aras-p.info/blog/2019/01/16/time-trace-timeline-flame-chart-profiler-for-Clang/ - https://reviews.llvm.org/rL357340
2020-02-01Auto merge of #68133 - Centril:slimmer-syntax, r=petrochenkovbors-1/+2
Slimmer syntax High-level summary of changes: - The `syntax::node_count` pass is moved into `rustc_ast_passes`. This works towards improving #65031 by making compiling `syntax` go faster. - The `syntax::{GLOBALS, with_globals, ..}` business is consolidated into `syntax::attr` for cleaner code and future possible improvements. - The pretty printer loses its dependency on `ParseSess`, opting to use `SourceMap` & friends directly instead. - Some drive by cleanup of `syntax::attr::HasAttr` happens. - Builtin attribute logic (`syntax::attr::builtin`) + `syntax::attr::allow_internal_unstable` is moved into a new `rustc_attr` crate. More logic from `syntax::attr` should be moved into that crate over time. This also means that `syntax` loses all mentions of `ParseSess`, which enables the next point. - The pretty printer `syntax::print` is moved into a new crate `rustc_ast_pretty`. - `rustc_session::node_id` is moved back as `syntax::node_id`. As a result, `syntax` gets to drop dependencies on `rustc_session` (and implicitly `rustc_target`), `rustc_error_codes`, and `rustc_errors`. Moreover `rustc_hir` gets to drop its dependency on `rustc_session` as well. At this point, these crates are mostly "pure data crates", which is approaching a desirable end state. - We should consider renaming `syntax` to `rustc_ast` now.
2020-02-01Move builtin attribute logic to new rustc_attr crate.Mazdak Farrokhzad-1/+2
For now, this is all the crate contains, but more attribute logic & types will be moved there over time.
2020-02-01Auto merge of #68180 - ajpaverd:cfguard-rust, r=nagisabors-1/+11
Add support for Control Flow Guard on Windows. LLVM now supports Windows Control Flow Guard (CFG): https://github.com/llvm/llvm-project/commit/d157a9bc8ba1085cc4808c6941412322a7fd884e This patch adds support for rustc to emit the required LLVM module flags to enable CFG metadata (cfguard=1) or metadata and checks (cfguard=2). The LLVM module flags are ignored on unsupported targets and operating systems.
2020-01-28Add support for Control Flow Guard on Windows.Andrew Paverd-1/+11
This patch enables rustc to emit the required LLVM module flags to enable Control Flow Guard metadata (cfguard=1) or metadata and checks (cfguard=2). The LLVM module flags are ignored on unsupported targets and operating systems.
2020-01-27Detect use-after-scope bugs with AddressSanitizerTomasz Miąsko-4/+11
Enable use-after-scope checks by default when using AddressSanitizer. They allow to detect incorrect use of stack objects after their scope have already ended. The detection is based on LLVM lifetime intrinsics. To facilitate the use of this functionality, the lifetime intrinsics are now emitted regardless of optimization level if enabled sanitizer makes use of them.
2020-01-23Add projection query for upstream drop-glue instances.Michael Woerister-6/+1
This reduces the amount of invalidated data when new types are add to upstream crates.
2020-01-23Clarify some methods around instance instantiation via comments and clearer ↵Michael Woerister-1/+1
names.
2020-01-23Add `-Z no-link` flagVictor Ding-0/+15
Adds a compiler option to allow rustc compile a crate without linking. With this flag, rustc serializes codegen_results into a .rlink file.
2020-01-17Actually pass target LLVM args to LLVMJethro Beekman-2/+3
2020-01-14Auto merge of #67711 - Amanieu:fix_unwind_leak, r=alexcrichtonbors-5/+26
Fix memory leak if C++ catches a Rust panic and discards it If C++ catches a Rust panic using `catch (...)` and then chooses not to rethrow it, the `Box<dyn Any>` in the exception may be leaked. This PR fixes this by adding the necessary destructors to the exception object. r? @Mark-Simulacrum
2020-01-13Auto merge of #67900 - nikic:prepare-llvm-10, r=nagisabors-0/+9
Prepare for LLVM 10 upgrade Split off from #67759, this just adds the necessary compatibility bits and updates codegen tests, without performing the actual LLVM upgrade. r? @alexcrichton
2020-01-11Auto merge of #67000 - spastorino:remove-promoted-from-place, r=oli-obkbors-2/+2
Promote references to constants instead of statics r? @oli-obk
2020-01-11Rollup merge of #67889 - Zoxc:parallel-cgus, r=michaelwoeristerMazdak Farrokhzad-9/+7
Compile some CGUs in parallel at the start of codegen This brings the compilation time for `syntex_syntax` from 11.542s to 10.453s with 6 threads in non-incremental debug mode. Just compiling `n` CGUs in parallel at the beginning of codegen seems sufficient to get rid of the staircase effect, at least for `syntex_syntax`. Based on https://github.com/rust-lang/rust/pull/67777. r? @michaelwoerister cc @alexcrichton @Mark-Simulacrum
2020-01-11Apply review feedbackAmanieu d'Antras-1/+5
2020-01-11Explain flag value of 8 for msvc_tryAmanieu d'Antras-1/+5
2020-01-11Fix a memory leak in SEH unwinding if a Rust panic is caught by C++ and ↵Amanieu d'Antras-5/+18
discarded
2020-01-11Rollup merge of #68059 - jethrogb:jb/target-llvm-args, r=alexcrichtonYuki Okushi-9/+6
Allow specifying LLVM args in target specifications
2020-01-10Remove PlaceBase enum and make Place base field be local: LocalSantiago Pastorino-2/+2
2020-01-10Allow specifying LLVM args in target specificationsJethro Beekman-9/+6
2020-01-09Compile some CGUs in parallel at the start of codegenJohn Kåre Alsaker-9/+7
2020-01-10Rollup merge of #68040 - sinkuu:unused, r=petrochenkovYuki Okushi-1/+0
Cleanup
2020-01-09Change -Z time event naming scheme and make them generic activitiesJohn Kåre Alsaker-11/+27
2020-01-09Remove unused dependenciesShotaro Yamada-1/+0
2020-01-07Remove support for datalayout upgradeNikita Popov-16/+2
Only keep the downgrade code
2020-01-07Auto-upgrade data layouts for X86 address spacesNikita Popov-0/+23
This is similar to the autoupdate LLVM performs internally.
2020-01-06Auto merge of #67886 - Centril:rustc_hir_canon_imports, r=nagisabors-16/+18
Nix `rustc_hir` reexports in rustc::hir r? @Zoxc cc @Mark-Simulacrum
2020-01-05Rename Instance.ty to Instance.monomorphic_tyAaron Hill-6/+6
2020-01-05Remove rustc_hir reexports in rustc::hir.Mazdak Farrokhzad-16/+18
2020-01-05Use self profile infrastructure for -Z time and -Z time-passesJohn Kåre Alsaker-116/+98
2020-01-04DefId{Map,Set} -> rustc::hir::def_idMazdak Farrokhzad-2/+1