Commit Graph

83 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
varkor 9f1269f23c Rename to `then_some` and `then` 2019-12-06 12:24:54 +00:00
varkor e3a8ea4e18 Use `to_option` in various places 2019-12-06 12:23:23 +00:00
Adam Perry aec97e050e Panicking infra uses &core::panic::Location.
This allows us to remove `static_panic_msg` from the SSA<->LLVM
boundary, along with its fat pointer representation for &str.

Also changes the signature of PanicInfo::internal_contructor to
avoid copying.

Closes #65856.
2019-10-27 12:50:58 -07:00
Adam Perry 743964ad3f Implement core::intrinsics::caller_location.
Returns a `&core::panic::Location` corresponding to where it was
called, also making `Location` a lang item.
2019-10-27 12:50:52 -07:00
bjorn3 f0e2fc7623 Improve type safety 2019-10-13 14:43:58 +02:00
bjorn3 bcb01bca86 Remove MiscMethods::instances 2019-10-13 14:43:57 +02:00
bjorn3 f1ed3a8786 s/FuncId/Function 2019-10-13 14:35:14 +02:00
bjorn3 cf858a8ac0 Remove is_const_integral method from ConstMethods 2019-10-13 14:35:14 +02:00
bjorn3 4d1a5ade9b Introduce FuncId backend type 2019-10-13 14:35:14 +02:00
Mazdak Farrokhzad 085c9e691e
Rollup merge of #64003 - Dante-Broggi:place-align-in-layout, r=matthewjasper
place: Passing `align` = `layout.align.abi`, when also passing `layout`

Of the calls changed:
7/12 use `align` = `layout.align.abi`.
`from_const_alloc` uses `alloc.align`, but that is `assert_eq!` to `layout.align.abi`.
only 4/11 use something interesting for `align`.
2019-09-05 12:11:08 +02:00
Nicholas Nethercote d78b33a807 Remove `LocalInternedString` uses from `librustc_codegen_llvm`. 2019-09-04 14:23:45 +10:00
Dante-Broggi 8657fb1140 `new_sized` is mostly used without align
so rename it `new_sized_aligned`.
6/11 use `align` = `layout.align.abi`.
`from_const_alloc` uses `alloc.align`, but that is `assert_eq!` to `layout.align.abi`.
only 4/11 use something interesting for `align`.
2019-08-29 14:24:50 -04:00
Oliver Scherer ab949fdd64 Cast only where necessary 2019-08-17 11:29:17 +02:00
Oliver Scherer 1fb854a0f5 Do not generate allocations for zero sized allocations 2019-08-16 16:05:36 +02:00
Ralf Jung 30c63aa2b8 assert consistency 2019-08-02 23:02:53 +02:00
Ralf Jung e590b849b8 CTFE: simplify Value type by not checking for alignment 2019-08-02 23:02:53 +02:00
Nikita Popov 6fae7db65d Remove vector fadd/fmul reduction workarounds
The bugs that this was working around have been fixed in LLVM 9.
2019-07-20 18:49:50 +02:00
Nikita Popov 5c95f5fa6b Fix float add/mul reduction codegen
The accumulator is now respected for unordered reductions.
2019-07-09 21:55:29 +02:00
Lzu Tao 7646d4935b Remove use of mem::uninitialized in code_gen crate 2019-07-06 03:27:05 +00:00
Mark Rousskov 007d87f171 Permit use of mem::uninitialized via allow(deprecated) 2019-07-04 21:01:35 -04:00
Oliver Scherer fb37bf0037 Weave the alignment through `ByRef` 2019-06-19 09:53:32 +02:00
Ralf Jung 41c36fabef light refactoring of global AllocMap
* rename AllocKind -> GlobalAlloc. This stores the allocation itself, not just its kind.
* rename the methods that allocate stuff to have consistent names.
2019-05-30 13:05:05 +02:00
Ralf Jung 082da0c698 rename Scalar::Bits to Scalar::Raw and bits field to data 2019-05-26 11:08:03 +02:00
Vadim Petrochenkov 6c187cc0c6 Change return type of `TyCtxt::is_static` to bool
Add `TyCtxt::is_mutable_static`
2019-04-21 14:41:51 +03:00
bjorn3 7b94195c22 Remove const_{cstr,str_slice,get_elt,get_real} and is_const_real methods from cg_ssa
This introduces the static_panic_msg trait method to StaticBuilderMethods.
2019-03-29 17:17:12 +01:00
bjorn3 a3fa1161d2 Remove const_{fat_ptr,array,vector,bytes} from cg_ssa 2019-03-29 17:17:12 +01:00
Taiki Endo 1b7ca961d9 librustc_codegen_llvm => 2018 2019-02-18 03:58:58 +09:00
Mark Rousskov 2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
bors 7489ee9c6f Auto merge of #56461 - oli-obk:alloc_ids, r=RalfJung
Some cleanups around `AllocId` management

r? @eddyb
cc @RalfJung
2018-12-13 12:36:13 +00:00
Alexander Regueiro ee89c088b0 Various minor/cosmetic improvements to code 2018-12-07 23:53:34 +00:00
Oliver Scherer d6250191a6 s/alloc_type/alloc_kind/ 2018-12-04 09:39:09 +01:00
Oliver Scherer 2e00d648c0 s/AllocType/AllocKind/ 2018-12-03 16:31:20 +01:00
bjorn3 f47505e867 Rename static_bitcast to const_bitcast 2018-11-29 18:19:43 +01:00
bjorn3 aaca5a38ee Rename StaticMethods::static_ptrcast to ConstMethods::const_ptrcast 2018-11-29 18:19:43 +01:00
bjorn3 b3b6e4dd9b Some refactorings 2018-11-29 18:19:41 +01:00
Eduard-Mihai Burtescu 5b4747ded7 rustc_target: avoid using AbiAndPrefAlign where possible. 2018-11-22 05:01:49 +02: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 c9f26c2155 Beginning of moving all backend-agnostic code to rustc_codegen_ssa 2018-11-16 14:55:42 +02:00
Eduard-Mihai Burtescu 35b40f51fb [eddyb/rebase cleanup] abstracted Funclet 2018-11-16 14:40:12 +02:00
Denis Merigoux 566fa4d003 Moved common.rs enums 2018-11-16 14:38:19 +02:00
Denis Merigoux 39fd4d9274 Starting to move backend-agnostic code into codegen_utils
IntPredicate moved
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 034f69753b Generalized base::unsized_info 2018-11-16 14:15:13 +02:00
Eduard-Mihai Burtescu 484e07c231 [eddyb/rebase cleanup] s/&self./self. 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