Commit Graph

44 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 8b06209c28 rustc_codegen_ssa: rename FnTypeLlvmExt to FnAbiLlvmExt. 2019-11-03 09:23:50 +02:00
Eduard-Mihai Burtescu 6567154ede rustc_target: rename {Fn,Arg}Type to {Fn,Arg}Abi. 2019-11-03 09:23:43 +02:00
Vadim Petrochenkov 434152157f Remove lint annotations in specific crates that are already enforced by rustbuild
Remove some random unnecessary lint `allow`s
2019-07-28 18:46:24 +03:00
Eduard-Mihai Burtescu 87b6b86468 rustc_codegen_llvm: `deny(unused_lifetimes)`. 2019-06-12 16:02:03 +03:00
Saleem Jaffer e1b3c79d5c refactor complete 2019-05-14 15:20:29 +05:30
bjorn3 b71c429007 Remove type_variadic_func and typ_array from cg_ssa 2019-03-29 17:17:13 +01:00
bjorn3 0e166bb217 Remove a lot of methods from *TypeMethods 2019-03-29 17:17:13 +01:00
bjorn3 b0ee1f7f99 Remove scalar_lltypes from cg_ssa 2019-03-29 17:17:13 +01:00
Mazdak Farrokhzad 9661a81968 librustc_codegen_llvm: deny(elided_lifetimes_in_paths) 2019-02-25 08:40:18 +01:00
kennytm 6e991011dc
Rollup merge of #58562 - dlrobertson:fix_nits, r=alexreg
Fix style nits

Fix style nits discovered in reading code.

r? @alexreg
2019-02-20 11:59:13 +08:00
Dan Robertson f8b6449f80
Fix style nits
Fix style nits discovered in reading code.
2019-02-18 22:22:19 +00:00
Taiki Endo 1b7ca961d9 librustc_codegen_llvm => 2018 2019-02-18 03:58:58 +09:00
Igor Matuszewski 7948b18414 Use `ptr::eq` where applicable 2019-01-12 16:18:55 +01:00
Mark Rousskov 2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
Alexander Regueiro ee89c088b0 Various minor/cosmetic improvements to code 2018-12-07 23:53:34 +00:00
bjorn3 b3b6e4dd9b Some refactorings 2018-11-29 18:19:41 +01:00
Eduard-Mihai Burtescu 0b569249c8 [eddyb] rustc_codegen_ssa: rename `interfaces` to `traits`. 2018-11-16 15:08:18 +02:00
Denis Merigoux b25b804013 Added default impl for DerivedTypeMethods + empty impl for Cranelift BaseTypeMethods 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 c9f26c2155 Beginning of moving all backend-agnostic code to rustc_codegen_ssa 2018-11-16 14:55:42 +02:00
Eduard-Mihai Burtescu b06836e71a [eddyb/rebase cleanup] move type_{needs_drop,is_sized,is_freeze} to rustc_codegen_utils 2018-11-16 14:40:16 +02:00
Denis Merigoux 566fa4d003 Moved common.rs enums 2018-11-16 14:38:19 +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 cbe31a4229 Generalized base::coerce_unsized_into 2018-11-16 14:15:13 +02:00
Denis Merigoux 78dd95f4c7 Generalized base::unsize_thin_ptr 2018-11-16 14:15:13 +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 0514c7b1b2 Generalized some base.rs methods 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 e224f063e8 Prefixed type methods & removed trait impl for write::CodegenContext 2018-11-16 14:11:59 +02:00
Denis Merigoux 730b13ab51 Traitification of type_ methods
The methods are now attached to CodegenCx instead of Type
2018-11-16 14:11:59 +02:00
Denis Merigoux 8714e6bce6 Traitification of common.rs methods 2018-11-16 14:11:59 +02:00
Denis Merigoux 9c41e1aa10 Removed genericity over Value in various functions
Prelude to using associated types in traits rather than type parameters
2018-11-16 14:11:34 +02:00
Denis Merigoux 34c5dc045f Generalized base.rs#call_memcpy and everything that it uses
Generalized operand.rs#nontemporal_store and fixed tidy issues

Generalized operand.rs#nontemporal_store's implem even more
With a BuilderMethod trait implemented by Builder for LLVM

Cleaned builder.rs : no more code duplication, no more ValueTrait

Full traitification of builder.rs
2018-11-16 14:11:09 +02:00
Tim Neumann 50a2d47b4f Support for the program data address space option
of LLVM's Target Datalayout.

https://llvm.org/docs/LangRef.html#data-layout
2018-11-08 17:46:30 +01:00
Michael Woerister 88d84b38f1 Introduce SmallCStr and use it where applicable. 2018-08-10 11:13:00 +02:00
Irina Popa eed48f560f rustc_codegen_llvm: use safe references for Metadata and DI*. 2018-07-30 19:27:13 +03:00
Irina Popa d04e66d114 rustc_codegen_llvm: use safe references for Type. 2018-07-30 18:36:29 +03:00
Irina Popa 249d5acaec rustc_codegen_llvm: use safe references for Context and Module. 2018-07-30 18:27:52 +03:00
Irina Popa af04e9426c rustc_codegen_llvm: move from empty enums to extern types. 2018-07-30 18:12:47 +03:00
Irina Popa b63d7e2b1c Rename trans to codegen everywhere. 2018-05-17 15:08:30 +03:00