about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/context.rs
AgeCommit message (Collapse)AuthorLines
2020-05-02Rollup merge of #71787 - tshepang:rustdoc-warnings, r=varkorDylan DPC-3/+4
fix rustdoc warnings
2020-05-02cleanup: `config::CrateType` -> `CrateType`Vadim Petrochenkov-4/+5
2020-05-02fix rustdoc warningsTshepang Lekhonkhobe-3/+4
2020-04-26rustc_target: Stop using "string typing" for TLS modelsVadim Petrochenkov-15/+8
Introduce `enum TlsModel` instead.
2020-04-26codegen_llvm: Simplify logic for relaxing PIC into PIEVadim Petrochenkov-4/+9
2020-04-26rustc_target: Stop using "string typing" for relocation modelsVadim Petrochenkov-23/+4
Introduce `enum RelocModel` instead.
2020-04-18Detect mistyped associated consts in `Instance::resolve`.Eduard-Mihai Burtescu-0/+1
2020-04-05Remove Arcs in queries.Camille GILLOT-5/+4
2020-04-02nix rustc_target::abi::* reexport in ty::layoutMazdak Farrokhzad-5/+4
2020-03-30rustc -> rustc_middle part 2Mazdak Farrokhzad-6/+6
2020-03-29Rollup merge of #69702 - anyska:tylayout-rename, r=oli-obkDylan DPC-4/+4
Rename TyLayout to TyAndLayout.
2020-03-27Rename TyLayout to TyAndLayout.Ana-Maria Mihalache-4/+4
2020-03-26Retire DepGraphSafe and HashStableContext.Camille GILLOT-3/+0
2020-03-23Rollup merge of #69940 - tmiasko:llvm-api, r=hanna-kruppeMazdak Farrokhzad-2/+2
librustc_codegen_llvm: Replace deprecated API usage
2020-03-20remove redundant returns (clippy::needless_return)Matthias Krüger-1/+1
2020-03-16use direct imports for `rustc::{lint, session}`.Mazdak Farrokhzad-9/+8
2020-03-13Auto merge of #67502 - Mark-Simulacrum:opt-catch, r=Mark-Simulacrumbors-46/+1
Optimize catch_unwind to match C++ try/catch This refactors the implementation of catching unwinds to allow LLVM to inline the "try" closure directly into the happy path, avoiding indirection. This means that the catch_unwind implementation is (after this PR) zero-cost unless a panic is thrown. https://rust.godbolt.org/z/cZcUSB is an example of the current codegen in a simple case. Notably, the codegen is *exactly the same* if `-Cpanic=abort` is passed, which is clearly not great. This PR, on the other hand, generates the following assembly: ```asm # -Cpanic=unwind: push rbx mov ebx,0x2a call QWORD PTR [rip+0x1c53c] # <happy> mov eax,ebx pop rbx ret mov rdi,rax call QWORD PTR [rip+0x1c537] # cleanup function call call QWORD PTR [rip+0x1c539] # <unfortunate> mov ebx,0xd mov eax,ebx pop rbx ret # -Cpanic=abort: push rax call QWORD PTR [rip+0x20a1] # <happy> mov eax,0x2a pop rcx ret ``` Fixes #64224, and resolves #64222.
2020-03-11librustc_codegen_llvm: Replace deprecated API usageTomasz Miąsko-2/+2
2020-03-05Remove eh_unwind_resume lang itemAmanieu d'Antras-46/+1
2020-03-04Don't use .ok() before unwrapping via .expect() on a Result.Matthias Krüger-1/+0
The Result can be expect-unwrapped directly. (clippy::ok_expect)
2020-02-12Fix mangled names of lifetime intrinsicsNikita Popov-2/+2
2020-02-12Use IRBuilder to create memsetNikita Popov-4/+0
To avoid creating memsets with outdated signature. For some reason SROA chokes on this when using NewPM.
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-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-05Remove rustc_hir reexports in rustc::hir.Mazdak Farrokhzad-2/+2
2020-01-04canonicalize FxHash{Map,Set} importsMazdak Farrokhzad-1/+1
2020-01-02Normalize `syntax::symbol` imports.Mazdak Farrokhzad-1/+1
2020-01-02Normalize `syntax::source_map` imports.Mazdak Farrokhzad-1/+1
2019-12-22Format the worldMark Rousskov-96/+89
2019-12-11rustc: Link LLVM directly into rustc againAlex Crichton-0/+2
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-03rustc: take a PolyFnSig instead of an FnSig in FnAbi::of_fn_ptr.Eduard-Mihai Burtescu-2/+2
2019-12-03rustc: rename FnAbi::new to FnAbi::of_fn_ptr.Eduard-Mihai Burtescu-1/+1
2019-12-03rustc_codegen_ssa: take a FnAbi instead of a FnSig in declare_fn.Eduard-Mihai Burtescu-4/+6
2019-11-03Configure LLVM module PIC levelSamuel Holland-0/+4
As of LLVM 9, this is required for 32-bit PowerPC to properly generate PLT references. Previously, only BigPIC was supported; now LLVM supports both BigPIC and SmallPIC, and there is no default value provided.
2019-10-13Remove MiscMethods::instancesbjorn3-5/+5
2019-10-13Inline functions from cg_ssa::callee and remove the modbjorn3-3/+16
Fixes #65271
2019-10-10Auto merge of #59546 - sfanxiang:interminable-ub, r=nagisabors-0/+1
Add llvm.sideeffect to potential infinite loops and recursions LLVM assumes that a thread will eventually cause side effect. This is not true in Rust if a loop or recursion does nothing in its body, causing undefined behavior even in common cases like `loop {}`. Inserting llvm.sideeffect fixes the undefined behavior. As a micro-optimization, only insert llvm.sideeffect when jumping back in blocks or calling a function. A patch for LLVM is expected to allow empty non-terminate code by default and fix this issue from LLVM side. https://github.com/rust-lang/rust/issues/28728 **UPDATE:** [Mentoring instructions here](https://github.com/rust-lang/rust/pull/59546#issuecomment-515072429) to unstall this PR
2019-10-05Replaces some instances of `as *[const | mut] _` with `.cast()`memoryruins-1/+1
2019-09-28Add llvm.sideeffect to potential infinite loops and recursionsXiang Fan-0/+1
LLVM assumes that a thread will eventually cause side effect. This is not true in Rust if a loop or recursion does nothing in its body, causing undefined behavior even in common cases like `loop {}`. Inserting llvm.sideeffect fixes the undefined behavior. As a micro-optimization, only insert llvm.sideeffect when jumping back in blocks or calling a function. A patch for LLVM is expected to allow empty non-terminate code by default and fix this issue from LLVM side. https://github.com/rust-lang/rust/issues/28728
2019-09-04Remove `LocalInternedString` uses from `librustc_codegen_llvm`.Nicholas Nethercote-2/+2
2019-08-04tweak output and testsEsteban Küber-4/+1
2019-08-04review comments: clean upEsteban Küber-3/+3
2019-08-03Point to local place span on "type too big" errorEsteban Küber-1/+9
2019-07-09Strip function pointer alignment for older LLVM versionsNikita Popov-6/+17
2019-06-18rustc: remove 'x: 'y bounds (except from comments/strings).Eduard-Mihai Burtescu-1/+1
2019-06-15Remove unnecessary `.clone()`Shotaro Yamada-1/+1
2019-06-14Unify all uses of 'gcx and 'tcx.Eduard-Mihai Burtescu-4/+4
2019-06-12Run `rustfmt --file-lines ...` for changes from previous commits.Eduard-Mihai Burtescu-6/+7
2019-06-12rustc: remove some unnecessary lifetimes in -> TyCtxt methods.Eduard-Mihai Burtescu-1/+1