81 Commits

Author SHA1 Message Date
Mark Rousskov
a06baa56b9 Format the world 2019-12-22 17:42:47 -05:00
Aaron Hill
fca192cca2
Fix fallout from rebase 2019-12-11 09:50:12 -05:00
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
5b7d0f389f rustc_codegen_llvm: move NoReturn attribute to apply_attrs_llfn. 2019-12-03 15:28:18 +02:00
Alexander Regueiro
51cb60cd3f Aggregation of drive-by cosmetic changes. 2019-11-21 18:50:38 +00:00
Eduard-Mihai Burtescu
8b06209c28 rustc_codegen_ssa: rename FnTypeLlvmExt to FnAbiLlvmExt. 2019-11-03 09:23:50 +02:00
Eduard-Mihai Burtescu
0ea40ec76a rustc_codegen_ssa: rename ArgTypeMethods to ArgAbiMethods. 2019-11-03 09:23:50 +02:00
Eduard-Mihai Burtescu
89c8f3abca rustc: rename {Fn,Arg}TypeExt to {Fn,Arg}AbiExt. 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
Eduard-Mihai Burtescu
a88d181a02 rustc: rely on c_variadic == true instead of CVarArgs in HIR/Ty fn signatures. 2019-09-28 17:39:00 +03:00
Eduard-Mihai Burtescu
e9214a147b codegen: be more explicit about setting giving names to allocas. 2019-09-12 19:04:30 +03:00
Nikita Popov
eb33822091 Pass type to byval attributes 2019-07-09 21:55:29 +02:00
Saleem Jaffer
44eb607d76 removes AbiMethods 2019-05-14 21:23:01 +05:30
Saleem Jaffer
e1b3c79d5c refactor complete 2019-05-14 15:20:29 +05:30
Saleem Jaffer
3031705009 some more refactor of FnType. Things build now 2019-05-14 14:14:12 +05:30
Saleem Jaffer
11426a4d50 refactor some FnType stuff to rustc::ty::layout 2019-05-10 13:43:22 +05:30
Saleem Jaffer
80d5478649 removing param_env from pointee_info_at 2019-05-04 18:06:40 +05:30
Saleem Jaffer
199ff02dac resolving conflicts 2019-05-04 15:17:26 +05:30
Daan de Graaf
82410e800f impl pointee_info_at in TyLayout. 2019-05-04 15:17:26 +05:30
Daan de Graaf
f1f9343c3d Remove old pointee_info_at body. 2019-05-04 15:17:26 +05:30
varkor
a3470c6189 Update handling of Tuple 2019-04-26 21:09:32 +01:00
Matthew Jasper
7eda723279 Fix cases of conflicting two-phase borrows 2019-04-04 18:47:10 +01:00
bjorn3
7de0b1de19 Move get_param and set_value_name 2019-03-29 17:17:13 +01:00
Dan Robertson
08bd4ff998
Rename variadic to c_variadic
Function signatures with the `variadic` member set are actually
C-variadic functions. Make this a little more explicit by renaming the
`variadic` boolean value, `c_variadic`.
2019-02-27 10:21:54 -05:00
Dan Robertson
58147d486b
Support defining C compatible variadic functions
Add support for defining C compatible variadic functions in unsafe rust
with extern "C".
2019-02-27 10:21:35 -05: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
Mazdak Farrokhzad
6ce748ac38
Rollup merge of #57085 - glaubitz:sparc64-abi-fix, r=nagisa
librustc_codegen_llvm: Don't eliminate empty structs in C ABI on linux-sparc64

This is in accordance with the SPARC Compliance Definition 2.4.1,
Page 3P-12. It says that structs of up to 8 bytes (which applies
to empty structs as well) are to be passed in one register.
2018-12-24 13:29:37 +01:00
Michael Karcher
65dabd6eaf librustc_codegen_llvm: Don't eliminate empty structs in C ABI on linux-sparc64
This is in accordance with the SPARC Compliance Definition 2.4.1,
Page 3P-12. It says that structs of up to 8 bytes (which applies
to empty structs as well) are to be passed in one register.
2018-12-23 23:46:45 +01:00
Nikita Popov
db24d8e8e2 Enable emission of alignment attrs for pointer params
Instead disable creation of assumptions during inlining using an
LLVM opt flag.

The -Z arg-align-attributes option which previously controlled this
behavior is removed.
2018-12-21 00:31:18 +01:00
Alexander Regueiro
ee89c088b0 Various minor/cosmetic improvements to code 2018-12-07 23:53:34 +00:00
bjorn3
ceb29e2ac4 Use implicit deref instead of BuilderMethods::cx() 2018-11-29 18:19:44 +01:00
Eduard-Mihai Burtescu
5b4747ded7 rustc_target: avoid using AbiAndPrefAlign where possible. 2018-11-22 05:01:49 +02:00
Eduard-Mihai Burtescu
3ce8d444af rustc_target: separate out an individual Align from AbiAndPrefAlign. 2018-11-22 04:38:00 +02:00
Eduard-Mihai Burtescu
0b569249c8 [eddyb] rustc_codegen_ssa: rename interfaces to traits. 2018-11-16 15:08:18 +02:00
Denis Merigoux
54dd3a47fd All Builder methods now take &mut self instead of &self 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
6a993fe353 Generalized mir::codegen_mir (and all subsequent functions) 2018-11-16 14:33:10 +02:00
Denis Merigoux
a5aeb8edd6 Transfered memcpy and memset to BuilderMethods 2018-11-16 14:11:59 +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
e224f063e8 Prefixed type methods & removed trait impl for write::CodegenContext 2018-11-16 14:11:59 +02:00
Denis Merigoux
6d42574b7a Prefixed const methods with "const" instead of "c" 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
3e77f2fc4f Use the method form for CodegenCx everywhere 2018-11-16 14:11:59 +02:00
Denis Merigoux
d325844804 Replaced Codegen field access by trait method 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
d577ec7e5f New files and folders for traits
Moved common enums to common
2018-11-16 14:11:59 +02:00