about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/back/write.rs
AgeCommit message (Collapse)AuthorLines
2019-12-02Use Module::print() instead of a PrintModulePassVictor Ding-8/+5
llvm::Module has a print() method. It is unnecessary to create a pass just for the purpose of printing LLVM IR.
2019-12-01rustc_plugin: Remove support for plugins adding LLVM passesVadim Petrochenkov-14/+0
2019-11-29Use LLVMAddAnalysisPasses instead of Rust's wrapperVictor Ding-3/+3
LLVM exposes a C API `LLVMAddAnalysisPasses` and hence Rust's own wrapper `LLVMRustAddAnalysisPasses` is not needed anymore.
2019-11-22Create sanitizer passes in a separate functionTomasz Miąsko-20/+26
2019-11-22Add support for tracking origins of uninitialized memoryTomasz Miąsko-2/+2
2019-11-22Add support for sanitizer recoveryTomasz Miąsko-2/+1
2019-11-22Move sanitizer passes creation from ssa to llvmTomasz Miąsko-4/+25
2019-11-13Revert "Auto merge of #65134 - ↵Robin Kruppe-1/+3
davidtwco:issue-19834-improper-ctypes-in-extern-C-fn, r=rkruppe" This reverts commit 3f0e16473de5ec010f44290a8c3ea1d90e0ad7a2, reversing changes made to 61a551b4939ec1d5596e585351038b8fbd0124ba.
2019-11-06Auto merge of #65134 - davidtwco:issue-19834-improper-ctypes-in-extern-C-fn, ↵bors-3/+1
r=rkruppe improper_ctypes: `extern "C"` fns cc #19834. Fixes #65867. This pull request implements the change [described in this comment](https://github.com/rust-lang/rust/issues/19834#issuecomment-466671572). cc @rkruppe @varkor @shepmaster
2019-11-05codegen_llvm: remove unnecessary "extern C"David Wood-4/+1
Signed-off-by: David Wood <david@davidtw.co>
2019-11-05improper_ctypes: `extern "C"` fnsDavid Wood-0/+1
2019-10-29Allow specifying key "llvm-abiname" in target specificationGui Andrade-1/+2
This addresses #65024, as it allows RISC-V target specification files to set "llvm-abiname": "lp64d". In general, it is useful for the programmer to be able to set this codegen parameter, which other languages usually expose under a compiler argument like "-mabi=<XYZ>".
2019-10-08Rollup merge of #65081 - Mark-Simulacrum:remove-profile-queries, ↵Mazdak Farrokhzad-3/+1
r=michaelwoerister Remove -Zprofile-queries r? @michaelwoerister Per [zulip thread](https://zulip-archive.rust-lang.org/131828tcompiler/57361RemoveZprofilequeries.html).
2019-10-05Replaces some instances of `as *[const | mut] _` with `.cast()`memoryruins-7/+7
2019-10-03Remove -Zprofile-queriesMark Rousskov-3/+1
2019-09-30Self-Profiling: Make names of existing events more consistent and use new API.Michael Woerister-11/+14
2019-07-15Don't add extra passes into the function pass managerNikita Popov-39/+49
Exception for specific cases like linting, additional passes should be going into the module pass manager (even if they are function passes). The separate function pass manager is only used for very early optimization passes. Rather than apparending passes to the MPM, use the OptimizerLast and EnabledOnOptLevel0 pass manager builder extension hooks, which allow adding passes directly before finalization (alias canonicalization and name-anon-globals). The main effect and purpose of this change is to add sanitizer passes at the end of the pipeline, which is where they belong. In LLVM 9 the address sanitizer can't be used as a pass in the early function pass manager, because it has a dependence on a module-level analysis pass.
2019-07-03Remove needless lifetimesJeremy Stucki-3/+3
2019-06-14Unify all uses of 'gcx and 'tcx.Eduard-Mihai Burtescu-1/+1
2019-06-12rustc: replace `TyCtxt<'tcx, 'gcx, 'tcx>` with `TyCtxt<'gcx, 'tcx>`.Eduard-Mihai Burtescu-1/+1
2019-05-28Rename PgoGenerate to something more general.Michael Woerister-3/+3
2019-05-27Use a PathBuf instead of String for representing the pgo-use path internally.Michael Woerister-5/+3
2019-05-16add targetarch for CodegenContextChandler Deng-2/+2
2019-04-20Move some filename constants to cg_ssabjorn3-2/+2
2019-04-14Rollup merge of #59874 - michaelwoerister:pgo-updates-1, r=cramertjMazdak Farrokhzad-6/+16
Clean up handling of `-Z pgo-gen` commandline option. This PR adapts the `-Z pgo-gen` flag to how Clang and GCC handle the corresponding `-fprofile-generate` flag. In particular, the flag now optionally takes a directory to place the profiling data in and allows to omit the argument (instead of having to pass an empty string).
2019-04-14Rollup merge of #59812 - michaelwoerister:profile-gen-msvc-imp, r=alexcrichtonMazdak Farrokhzad-1/+17
Exclude profiler-generated symbols from MSVC __imp_-symbol workaround. LLVM's profiling instrumentation adds a few symbols that are used by the profiler runtime. Since these show up as globals in the LLVM IR, the compiler generates `dllimport`-related `__imp_` stubs for them. This can lead to linker errors because the instrumentation symbols have weak linkage or are in a comdat section, but the `__imp_` stubs aren't. Instead of trying to replicate the linkage/comdat setup for the stubs, this PR just excludes the profiler-related symbols from stub-generation since they aren't supposed to be referenced via `__declspec(dllimport)` anywhere anyway. r? @alexcrichton EDIT: I considered making this more general, i.e. inferring from the symbol name if it is a Rust symbol or not. But then I figured out that that would yield false negatives for `#[no_mangle]` et al, so I went with a blacklist approach.
2019-04-12Use measureme in self-profilerWesley Wiser-13/+11
Related to #58372 Related to #58967
2019-04-11Clean up handling of -Zpgo-gen commandline option.Michael Woerister-6/+16
2019-04-09Exclude profiler-generated symbols from MSVC __imp_-symbol workaround.Michael Woerister-1/+17
2019-04-05Show better errors for LLVM IR outputJosh Stone-10/+15
I was trying to output LLVM IR directly to the console: $ rustc hello.rs --emit=llvm-ir -o /dev/stdout LLVM ERROR: IO failure on output stream: Bad file descriptor Now `LLVMRustPrintModule` returns an error, and we print: error: failed to write LLVM IR to /dev/stdout.hello.7rcbfp3g-cgu.0.rcgu.ll: Permission denied ... which is more informative.
2019-03-27Use informational target machine for metadataSimonas Kazlauskas-9/+10
Since there is nothing to optimise there...
2019-03-10Replace TimeLine with SelfProfilerWesley Wiser-27/+31
2019-02-25librustc_codegen_llvm: deny(elided_lifetimes_in_paths)Mazdak Farrokhzad-1/+1
2019-02-18librustc_codegen_llvm => 2018Taiki Endo-15/+14
2019-02-12Stabilize linker-plugin based LTO.Michael Woerister-1/+1
2019-01-24Implement optimize(size) and optimize(speed)Simonas Kazlauskas-22/+29
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-1/+1
2018-12-03Auto merge of #56358 - nikic:mergefunc-aliases, r=rkruppebors-4/+5
Enable -mergefunc-use-aliases If the Rust LLVM fork is used, enable the -mergefunc-use-aliases flag, which will create aliases for merged functions, rather than inserting a call from one to the other. A number of codegen tests needed to be adjusted, because functions that previously fell below the thunk limit are now being merged. Merging is prevented in various ways now. I expect that this is going to break something, somewhere, because it isn't able to deal with aliases properly, but we won't find out until we try :) This fixes #52651. r? @rkruppe
2018-12-02Run name-anon-globals after all other passesNikita Popov-4/+5
name-anon-globals should always be run at the very end of the pass pipeline, as optimization passes (in particular mergefunc) may introduce new anonymous globals. I believe we did not run into this earlier because it requires the rather specific combination of a) mergefunc merging two weak functions b) compilation not using thinlto.
2018-11-29Rename conversion util; remove duplicate util in librustc_codegen_llvm.Corey Farwell-5/+5
2018-11-16[eddyb] rustc_codegen_ssa: rename `interfaces` to `traits`.Eduard-Mihai Burtescu-1/+1
2018-11-16Separating the back folder between backend-agnostic and LLVM-specific codeDenis Merigoux-1827/+43
2018-11-16Finished moving backend-agnostic code to rustc_codegen_ssaDenis Merigoux-2/+1
2018-11-16Beginning of moving all backend-agnostic code to rustc_codegen_ssaDenis Merigoux-1/+1
2018-11-16Moved Backend interface into rustc_codegen_utilsDenis Merigoux-2/+2
2018-11-16Generalized base:codegen_crateDenis Merigoux-11/+11
2018-11-16Removed phantomdata no longer necessaryDenis Merigoux-11/+6
Because CodegenContext doesn't implement Backend anymore
2018-11-16Removing LLVM content from CommonMethods -> ConstMethodsDenis Merigoux-24/+5
2018-11-16Prefixed type methods & removed trait impl for write::CodegenContextDenis Merigoux-22/+3