about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm
AgeCommit message (Collapse)AuthorLines
2020-03-02Avoid over-aligning the return value in the -Cpanic=abort caseMark Rousskov-2/+4
2020-03-01Rollup merge of #69569 - matthiaskrgr:nonminimal_bool, r=mark-SimulacrumDylan DPC-1/+1
simplify boolean expressions
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-15/+15
2020-02-29Make it build againVadim Petrochenkov-1/+1
2020-02-29simplify boolean expressionsMatthias Krüger-1/+1
2020-02-29Rollup merge of #69551 - matthiaskrgr:len_zero, r=Mark-SimulacrumDylan DPC-2/+2
use is_empty() instead of len() == x to determine if structs are empty.
2020-02-28use is_empty() instead of len() == x to determine if structs are empty.Matthias Krüger-2/+2
2020-02-27use char instead of &str for single char patternsMatthias Krüger-1/+1
2020-02-26Use byte offsets when emitting debuginfo columnsTomasz Miąsko-45/+57
2020-02-26Emit 1-based column numbers in debuginfoTomasz Miąsko-2/+4
The debuginfo column numbers are 1-based. The value 0 indicates that no column has been specified. Translate 0-based column numbers to 1-based when emitting debug information.
2020-02-15Change `const_field` and `const_caller_location` to return `ConstValue` ↵Ben Lewis-2/+1
instead of `Const` as the type in the returned const isn't needed.
2020-02-15Change const eval to return `ConstValue`, instead of `Const` as the type ↵Ben Lewis-6/+5
inside it shouldn't be used.
2020-02-13add selfprofiling for new llvm passmanagerAndreas Jonson-2/+88
2020-02-12Rollup merge of #67954 - nikic:new-pm, r=nagisaDylan DPC-32/+193
Support new LLVM pass manager Add support for the new LLVM pass manager behind a `-Z new-llvm-pass-manager=on` option. Both the pre-link optimization and LTO pipelines use the new pass manager. There's some bits that are not supported yet: * `-C passes`. NewPM requires an entirely different way of specifying custom pass pipelines. We should probably expose that functionality, but it doesn't directly map to what `-C passes` does. * NewPM has no support for custom inline parameters right now. We'd have to add upstream support for that first. * NewPM does not support PGO at O0 in LLVM 9 (which is why those tests fail with NewPM enabled). This is supported in LLVM 10. * NewPM does not support MergeFunctions in LLVM 9. I've landed this upstream just before the cut, so we'll be able to re-enable that with LLVM 10. Closes #64289. r? @ghost
2020-02-12Add support for new pass managerNikita Popov-18/+170
The new pass manager can be enabled using -Z new-llvm-pass-manager=on.
2020-02-12Fix mangled names of lifetime intrinsicsNikita Popov-4/+4
2020-02-12Use IRBuilder to create memsetNikita Popov-10/+19
To avoid creating memsets with outdated signature. For some reason SROA chokes on this when using NewPM.
2020-02-12Rollup merge of #69089 - nox:sym64-crash, r=eddybDylan DPC-0/+2
Properly use the darwin archive format on Apple targets See https://github.com/servo/servo/issues/25550.
2020-02-12Properly use the darwin archive format on Apple targetsAnthony Ramine-0/+2
See https://github.com/servo/servo/issues/25550.
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