about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/lib.rs
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-400/+0
2020-07-05Use for<'tcx> fn pointers in Providers, instead of having Providers<'tcx>.Eduard-Mihai Burtescu-2/+2
2020-06-29add spans to injected coverage countersRich Kadel-0/+1
added regions with counter expressions and counters. Added codegen_llvm/coverageinfo mod for upcoming coverage map Move coverage region collection to CodegenCx finalization Moved from `query coverageinfo` (renamed from `query coverage_data`), as discussed in the PR at: https://github.com/rust-lang/rust/pull/73684#issuecomment-649882503 Address merge conflict in MIR instrument_coverage test The MIR test output format changed for int types. moved debug messages out of block.rs This makes the block.rs calls to add coverage mapping data to the CodegenCx much more concise and readable. move coverage intrinsic handling into llvm impl I realized that having half of the coverage intrinsic handling in `rustc_codegen_ssa` and half in `rustc_codegen_llvm` meant that any non-llvm backend would be bound to the same decisions about how the coverage-related MIR terminators should be handled. To fix this, I moved the non-codegen portion of coverage intrinsic handling into its own trait, and implemented it in `rustc_codegen_llvm` alongside `codegen_intrinsic_call`. I also added the (required?) stubs for the new intrinsics to `IntrepretCx::emulate_intrinsic()`, to ensure calls to this function do not fail if called with these new but known intrinsics. address PR Feedback on 28 June 2020 2:48pm PDT
2020-05-20llvm: Expose tiny code model to usersVadim Petrochenkov-1/+1
2020-05-16rustc_target: Stop using "string typing" for code modelsVadim Petrochenkov-1/+1
Introduce `enum CodeModel` instead.
2020-04-29Auto merge of #71528 - alexcrichton:no-more-bitcode, r=nnethercotebors-1/+0
Store LLVM bitcode in object files, not compressed This commit is an attempted resurrection of #70458 where LLVM bitcode emitted by rustc into rlibs is stored into object file sections rather than in a separate file. The main rationale for doing this is that when rustc emits bitcode it will no longer use a custom compression scheme which makes it both easier to interoperate with existing tools and also cuts down on compile time since this compression isn't happening. The blocker for this in #70458 turned out to be that native linkers didn't handle the new sections well, causing the sections to either trigger bugs in the linker or actually end up in the final linked artifact. This commit attempts to address these issues by ensuring that native linkers ignore the new sections by inserting custom flags with module-level inline assembly. Note that this does not currently change the API of the compiler at all. The pre-existing `-C bitcode-in-rlib` flag is co-opted to indicate whether the bitcode should be present in the object file or not. Finally, note that an important consequence of this commit, which is also one of its primary purposes, is to enable rustc's `-Clto` bitcode loading to load rlibs produced with `-Clinker-plugin-lto`. The goal here is that when you're building with LTO Cargo will tell rustc to skip codegen of all intermediate crates and only generate LLVM IR. Today rustc will generate both object code and LLVM IR, but the object code is later simply thrown away, wastefully.
2020-04-29Store LLVM bitcode in object files, not compressedAlex Crichton-1/+0
This commit is an attempted resurrection of #70458 where LLVM bitcode emitted by rustc into rlibs is stored into object file sections rather than in a separate file. The main rationale for doing this is that when rustc emits bitcode it will no longer use a custom compression scheme which makes it both easier to interoperate with existing tools and also cuts down on compile time since this compression isn't happening. The blocker for this in #70458 turned out to be that native linkers didn't handle the new sections well, causing the sections to either trigger bugs in the linker or actually end up in the final linked artifact. This commit attempts to address these issues by ensuring that native linkers ignore the new sections by inserting custom flags with module-level inline assembly. Note that this does not currently change the API of the compiler at all. The pre-existing `-C bitcode-in-rlib` flag is co-opted to indicate whether the bitcode should be present in the object file or not. Finally, note that an important consequence of this commit, which is also one of its primary purposes, is to enable rustc's `-Clto` bitcode loading to load rlibs produced with `-Clinker-plugin-lto`. The goal here is that when you're building with LTO Cargo will tell rustc to skip codegen of all intermediate crates and only generate LLVM IR. Today rustc will generate both object code and LLVM IR, but the object code is later simply thrown away, wastefully.
2020-04-26rustc_target: Stop using "string typing" for TLS modelsVadim Petrochenkov-1/+1
Introduce `enum TlsModel` instead.
2020-04-26codegen_llvm: Simplify logic for relaxing PIC into PIEVadim Petrochenkov-8/+3
2020-04-26rustc_target: Stop using "string typing" for relocation modelsVadim Petrochenkov-1/+3
Introduce `enum RelocModel` instead.
2020-04-19Dogfood more or_patterns in the compilerJosh Stone-0/+1
2020-04-02use direct import for ErrorReportedMazdak Farrokhzad-2/+1
2020-03-30rustc -> rustc_middle part 3 (rustfmt)Mazdak Farrokhzad-4/+4
2020-03-30rustc -> rustc_middle part 2Mazdak Farrokhzad-4/+4
2020-03-19Refactorings to begin getting rid of rustc_codegen_utilsMark Mansi-1/+0
2020-03-16use direct imports for `rustc::{lint, session}`.Mazdak Farrokhzad-12/+11
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-1/+1
2020-02-13add selfprofiling for new llvm passmanagerAndreas Jonson-0/+1
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-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-04Remove unused feature gates from cg_llvmbjorn3-11/+4
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-01Add support for enabling the LLVM time-trace featureWesley Wiser-0/+6
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-01-23Add `-Z no-link` flagVictor Ding-0/+14
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-09Compile some CGUs in parallel at the start of codegenJohn Kåre Alsaker-3/+3
2020-01-09Change -Z time event naming scheme and make them generic activitiesJohn Kåre Alsaker-2/+2
2020-01-05Use self profile infrastructure for -Z time and -Z time-passesJohn Kåre Alsaker-5/+2
2020-01-01Rename `syntax_pos` to `rustc_span` in source codeVadim Petrochenkov-1/+1
2019-12-22Format the worldMark Rousskov-53/+51
2019-12-11Remove `extern crate` declarationsAaron Hill-20/+0
2019-12-11Fix fallout from rebaseAaron Hill-5/+0
2019-12-11rustc: Link LLVM directly into rustc againAlex Crichton-7/+4
This commit builds on #65501 continue to simplify the build system and compiler now that we no longer have multiple LLVM backends to ship by default. Here this switches the compiler back to what it once was long long ago, which is linking LLVM directly to the compiler rather than dynamically loading it at runtime. The `codegen-backends` directory of the sysroot no longer exists and all relevant support in the build system is removed. Note that `rustc` still supports a dynamically loaded codegen backend as it did previously, it just no longer supports dynamically loaded codegen backends in its own sysroot. Additionally as part of this the `librustc_codegen_llvm` crate now once again explicitly depends on all of its crates instead of implicitly loading them through the sysroot. This involved filling out its `Cargo.toml` and deleting all the now-unnecessary `extern crate` annotations in the header of the crate. (this in turn required adding a number of imports for names of macros too). The end results of this change are: * Rustbuild's build process for the compiler as all the "oh don't forget the codegen backend" checks can be easily removed. * Building `rustc_codegen_llvm` is much simpler since it's simply another compiler crate. * Managing the dependencies of `rustc_codegen_llvm` is much simpler since it's "just another `Cargo.toml` to edit" * The build process should be a smidge faster because there's more parallelism in the main rustc build step rather than splitting `librustc_codegen_llvm` out to its own step. * The compiler is expected to be slightly faster by default because the codegen backend does not need to be dynamically loaded. * Disabling LLVM as part of rustbuild is still supported, supporting multiple codegen backends is still supported, and dynamic loading of a codegen backend is still supported.
2019-12-06Use `to_option` in various placesvarkor-0/+1
2019-12-03Move cgu_reuse_tracker to librustc_sessionMark Rousskov-0/+1
2019-11-30move UnstableFeatures -> rustc_featureMazdak Farrokhzad-0/+1
2019-10-31rustc_codegen_ssa: hide address ops from the declare_local interface.Eduard-Mihai Burtescu-0/+1
2019-10-27rustc, rustc_passes: don't depend on syntax_expand.Mazdak Farrokhzad-2/+1
This is done by moving some data definitions to syntax::expand.
2019-10-24rustc: Add a convenience alias for `dyn MetadataLoader + Sync`Vadim Petrochenkov-2/+2
2019-10-21Use `Symbol` for codegen unit names.Nicholas Nethercote-2/+1
This is a straightforward replacement except for two places where we have to convert to `LocalInternedString` to get a stable sort.
2019-10-16move syntax::ext to new crate syntax_expandMazdak Farrokhzad-1/+2
2019-10-13Move span_invalid_monomorphization_error from cg_llvm to cg_ssabjorn3-3/+1
The associated long diagnostic didn't get registered before
2019-10-13Move some provides from cg_llvm to rustc_interfacebjorn3-5/+0
2019-10-13Remove unused method CodegenBackend::diagnosticsbjorn3-4/+0
2019-10-08Stabilize mem::take (mem_take)Jon Gjengset-1/+0
Tracking issue: https://github.com/rust-lang/rust/issues/61129
2019-10-01Rollup merge of #64840 - michaelwoerister:self-profiling-raii-refactor, ↵Tyler Mandry-2/+2
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-30Self-Profiling: Make names of existing events more consistent and use new API.Michael Woerister-2/+2
2019-09-29remove indexed_vec re-export from rustc_data_structurescsmoe-0/+1
2019-09-25Remove tx_to_llvm_workers from TyCtxtMark Rousskov-5/+8
This can be kept within the codegen backend crates entirely
2019-09-15use println!()Guanqun Lu-3/+3