Commit Graph

38 Commits

Author SHA1 Message Date
Alex Crichton 7f23e6e8d7
rustc: Link LLVM directly into rustc again
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-11 09:50:11 -05:00
Eduard-Mihai Burtescu 79d908b301 rustc_target: add abi::call::Conv::Rust distinct from Conv::C. 2019-12-03 15:55:21 +02:00
Eduard-Mihai Burtescu cd3c324b07 rustc_codegen_llvm: take an Instance in attributes::from_fn_attrs. 2019-12-03 15:55:21 +02:00
Eduard-Mihai Burtescu 052d0edbc1 rustc: compute FnAbi's for virtual calls through FnAbi::of_instance. 2019-12-03 15:41:56 +02:00
Eduard-Mihai Burtescu 4b68afe257 rustc_codegen_ssa: use FnAbi::of_instance wherever possible. 2019-12-03 15:41:43 +02:00
Eduard-Mihai Burtescu 95b944210f rustc_codegen_ssa: take a FnAbi instead of a FnSig in declare_fn. 2019-12-03 15:28:18 +02:00
bjorn3 bcb01bca86 Remove MiscMethods::instances 2019-10-13 14:43:57 +02:00
Nicholas Nethercote 0ad111f8bb Remove `LocalInternedString` uses from `librustc/ty/`.
This is not a compelling change in isolation, but it is a necessary
step.
2019-09-04 14:23:30 +10:00
Mark Mansi 8af151b30a remove reexport of rustc::ty::Instance 2019-06-02 22:32:42 -05:00
varkor 2ce19ae3d1 Use non_erasable_generics for codegen
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-03-05 22:07:37 +00:00
Taiki Endo 1b7ca961d9 librustc_codegen_llvm => 2018 2019-02-18 03:58:58 +09:00
Alexander Regueiro c3e182cf43 rustc: doc comments 2019-02-10 23:42:32 +00:00
Mark Rousskov 2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
Alex Crichton 1091eee65b rustc: Switch `extern` functions to abort by default on panic
This was intended to land way back in 1.24, but it was backed out due to
breakage which has long since been fixed. An unstable `#[unwind]`
attribute can be used to tweak the behavior here, but this is currently
simply switching rustc's internal default to abort-by-default if an
`extern` function panics, making our codegen sound primarily (as
currently you can produce UB with safe code)

Closes #52652
2018-12-12 08:07:28 -08:00
bjorn3 aaca5a38ee Rename StaticMethods::static_ptrcast to ConstMethods::const_ptrcast 2018-11-29 18:19:43 +01:00
Eduard-Mihai Burtescu 0b569249c8 [eddyb] rustc_codegen_ssa: rename `interfaces` to `traits`. 2018-11-16 15:08:18 +02:00
Denis Merigoux 015e4441f5 Finished moving backend-agnostic code to rustc_codegen_ssa 2018-11-16 15:08:18 +02:00
Denis Merigoux c0a428ee70 Great separation of librustc_codegen_llvm: librustc_codegen_ssa compiles 2018-11-16 15:07:24 +02:00
Denis Merigoux 97825a36be Move doc to trait declarations 2018-11-16 14:36:38 +02:00
Denis Merigoux 6a993fe353 Generalized mir::codegen_mir (and all subsequent functions) 2018-11-16 14:33:10 +02:00
Denis Merigoux 034f69753b Generalized base::unsized_info 2018-11-16 14:15:13 +02:00
Denis Merigoux d77e34f35b Generalized memset and memcpy 2018-11-16 14:11:59 +02:00
Denis Merigoux a1d0d4f943 Removing LLVM content from CommonMethods -> ConstMethods 2018-11-16 14:11:59 +02:00
Denis Merigoux 4cc18d3de5 CommonWriteMethods are not static any more 2018-11-16 14:11:59 +02:00
Denis Merigoux 3aee77277e Split CommonMethods to accomodate for use in back/write.rs 2018-11-16 14:11:59 +02:00
Denis Merigoux 8714e6bce6 Traitification of common.rs methods 2018-11-16 14:11:59 +02:00
scalexm d0447550da Shift both late bound regions and bound types 2018-11-03 11:41:51 +01:00
Masaki Hara e568e98063 Move codegen_llvm::common::ty_fn_sig into rustc::ty::Instance. 2018-10-24 21:59:07 +09:00
Masaki Hara 06b6b1c790 Make declare_fn accept PolyFnSig instead of Ty. 2018-10-24 21:59:07 +09:00
Masaki Hara f2ef005d1d Resolve to Instance::VtableShim when necessary. 2018-10-24 21:59:07 +09:00
Masaki Hara 1fb085511e Make declare_fn aware of vtable shims. 2018-10-24 21:59:06 +09:00
Masaki Hara fe3f606cda Add ty_fn_sig_vtable for getting adjusted signature for vtable shims. 2018-10-24 21:59:06 +09:00
Richard Diamond bfddedee37 AMDGPU ignores `noinline` when it slaps `alwaysinline` everywhere.
Allow target specs to disable that attribute.
2018-08-23 14:30:57 -05:00
Alex Crichton 31884427eb Set more llvm function attributes for __rust_try
This shim is generated elsewhere in the compiler so this commit adds support to
ensure it goes through similar paths as the rest of the compiler to set llvm
function attributes like target features.

cc #53372
2018-08-16 13:23:35 -07:00
Mark Rousskov a9093a4dd8 Move share_generics getter onto options directly 2018-08-04 06:54:36 -06:00
Irina Popa f375185314 rustc_codegen_llvm: use safe references for Value. 2018-07-30 19:49:18 +03:00
Alex Crichton f67453729c std: Ensure OOM is classified as `nounwind`
OOM can't unwind today, and historically it's been optimized as if it can't
unwind. This accidentally regressed with recent changes to the OOM handler, so
this commit adds in a codegen test to assert that everything gets optimized away
after the OOM function is approrpiately classified as nounwind

Closes #50925
2018-05-24 12:03:05 -07:00
Irina Popa b63d7e2b1c Rename trans to codegen everywhere. 2018-05-17 15:08:30 +03:00