Commit Graph

102 Commits

Author SHA1 Message Date
Eduard-Mihai Burtescu
cdeb4b0d25 rustc: encode scalar pairs in layout ABI. 2017-11-19 02:43:32 +02:00
Eduard-Mihai Burtescu
ac60872077 rustc_trans: generate LLVM pointee types based on alignment. 2017-11-19 02:14:33 +02:00
Eduard-Mihai Burtescu
f8d5d0c30c rustc_trans: compute better align/dereferenceable attributes from pointees. 2017-11-19 02:14:33 +02:00
Eduard-Mihai Burtescu
ced5e04e8b rustc: optimize out uninhabited types and variants. 2017-11-19 02:14:33 +02:00
Eduard-Mihai Burtescu
f62e43da28 rustc: track validity ranges for layout::Abi::Scalar values. 2017-11-19 02:14:33 +02:00
Eduard-Mihai Burtescu
5df25c4aed rustc: remove redundant/unused fields from layout::Abi::Vector. 2017-11-19 02:14:33 +02:00
Eduard-Mihai Burtescu
0190f270c1 rustc_trans: check for layout::I1 instead of TyBool. 2017-11-19 02:14:33 +02:00
Eduard-Mihai Burtescu
b28f668e26 rustc: move size, align & primitive_align from Abi::Aggregate to layout. 2017-11-19 02:14:32 +02:00
Eduard-Mihai Burtescu
b723af284a rustc_trans: go through layouts uniformly for fat pointers and variants. 2017-11-19 02:14:32 +02:00
Eduard-Mihai Burtescu
3fd6b00082 rustc_trans: query LLVM types from a layout instead of a Ty. 2017-11-19 02:14:32 +02:00
Eduard-Mihai Burtescu
1477119344 rustc_trans: keep a layout instead of a type in {Lvalue,Operand}Ref. 2017-11-19 02:14:32 +02:00
Eduard-Mihai Burtescu
88f70323e4 rustc_trans: nest abi::ArgType's for fat pointers instead of eagerly flattening. 2017-11-19 02:14:31 +02:00
Eduard-Mihai Burtescu
b2d52d2132 rustc: do not pub use Layout::* in layout. 2017-11-19 02:14:31 +02:00
Eduard-Mihai Burtescu
fad99542c8 rustc: split layout::FieldPlacement::Linear back into Union and Array. 2017-11-19 02:14:31 +02:00
Eduard-Mihai Burtescu
18d54aa7d5 rustc: move layout::Struct into FieldPlacement/Abi. 2017-11-19 02:14:31 +02:00
Eduard-Mihai Burtescu
08f9f134fd rustc: hide details in Layout in favor of Abi or FieldPlacement. 2017-11-19 02:14:31 +02:00
Eduard-Mihai Burtescu
bd51a2bc19 rustc: move size/alignment from Layout into layout::Abi. 2017-11-19 02:14:31 +02:00
Eduard-Mihai Burtescu
d318b9c27b rustc: move CEnum's signedness into Primitive::Int. 2017-11-19 02:14:30 +02:00
Eduard-Mihai Burtescu
61c2bd9ca4 rustc: use Primitive instead of Integer for CEnum and General discriminants. 2017-11-19 02:14:30 +02:00
Eduard-Mihai Burtescu
335bd8ea1b rustc: do not track non_zero in Layout. 2017-11-19 02:14:30 +02:00
Eduard-Mihai Burtescu
caef91d7c6 rustc: introduce layout::Abi for reduced general ABI "passing style". 2017-11-19 02:14:30 +02:00
Eduard-Mihai Burtescu
9a0efea4c2 rustc: pre-compute field placements out of Layout. 2017-11-19 02:14:29 +02:00
Eduard-Mihai Burtescu
8c4d5af52b rustc: remove Ty::layout and move everything to layout_of. 2017-11-19 02:14:29 +02:00
Eduard-Mihai Burtescu
8864668d53 rustc: re-complicate the TyLayout API and use better names. 2017-11-19 02:14:29 +02:00
Eduard-Mihai Burtescu
bc8e1f7efa rustc: use an offset instead of a field path in Layout::StructWrappedNullablePointer. 2017-11-19 02:14:29 +02:00
Eduard-Mihai Burtescu
84b5a3d84d rustc_trans: remove the in_memory_type_of distinction. 2017-11-19 02:14:28 +02:00
Eduard-Mihai Burtescu
5b1fdaeb80 rustc_trans: use more of the trans::mir and ty::layout APIs throughout. 2017-11-19 02:14:28 +02:00
Eduard-Mihai Burtescu
f44b099187 rustc_trans: avoid working with sizes/offsets and alignments as integers. 2017-11-19 02:14:24 +02:00
Björn Steinbrink
6bfecd41cc Avoid unnecessary allocas for indirect function arguments
The extra alloca was only necessary because it made LLVM implicitly
handle the necessary deref to get to the actual value. The same happens
for indirect arguments that have the byval attribute. But the Rust ABI
does not use the byval attribute and so we need to manually add the
deref operation to the debuginfo.
2017-10-18 12:58:15 +02:00
bors
97554e4b28 Auto merge of #45033 - eddyb:capture-me-not, r=nikomatsakis
rustc_trans: do not set NoCapture for anonymous lifetime &T arguments.

This was both unsound (due to lifetime elision & unsafe code) and dead code (we erase lifetimes).

r? @nikomatsakis
2017-10-09 00:18:51 +00:00
Eduard-Mihai Burtescu
ac25a4ac32 rustc_trans: do not set NoCapture for anonymous lifetime &T arguments. 2017-10-05 01:06:14 +03:00
Alexis Beingessner
a6dea41d64 Make -Cpanic=abort imply -Zmutable-noalias 2017-10-04 17:29:37 -04:00
Alexis Beingessner
36471293e6 Add -Zmutable-noalias flag 2017-10-03 19:49:45 -04:00
bors
3a7b960731 Auto merge of #44441 - tamird:cargo-bitflags, r=alexcrichton
Remove rustc_bitflags; use the bitflags crate

r? @alexcrichton
2017-09-18 07:00:28 +00:00
Tamir Duberstein
231d9e7e5d
Remove rustc_bitflags; use the bitflags crate 2017-09-17 14:19:24 -04:00
Alex Crichton
c72240acf7 rustc_trans: Refactor collection to use tcx
This commit refactors the `collect_crate_translation_items` function to only
require the `TyCtxt` instead of a `SharedCrateContext` in preparation for
query-ifying this portion of trans.
2017-09-17 09:41:43 -07:00
Eduard-Mihai Burtescu
3ce31eb990 rustc: replace usize with u64 and ConstUsize. 2017-09-11 08:41:15 +03:00
Zack M. Davis
1b6c9605e4 use field init shorthand EVERYWHERE
Like #43008 (f668999), but _much more aggressive_.
2017-08-15 15:29:17 -07:00
Josh Stone
5c6ccdc37c Correct the spelling of "homogeneous" 2017-07-21 18:08:40 -07:00
Ariel Ben-Yehuda
24c1a07c72 refactor trans::mir::block to trans all calls through the same code 2017-05-28 10:43:24 +03:00
Nathan Froyd
9a2e2450f9 add thiscall calling convention support
This support is needed for bindgen to work well on 32-bit Windows, and
also enables people to begin experimenting with C++ FFI support on that
platform.

Fixes #42044.
2017-05-24 16:40:03 -04:00
Michael Wu
c558a2ae37 Add Hexagon support
This requires an updated LLVM with D31999 and D32000 to build libcore.

A basic hello world builds and runs successfully on the hexagon simulator.
2017-04-25 01:56:44 -04:00
bors
6d841da4a0 Auto merge of #39999 - bitshifter:struct_align, r=eddyb
Implementation of repr struct alignment RFC 1358.

The main changes around rustc::ty::Layout::struct:
* Added abi_align field which stores abi alignment before repr align is applied
* align field contains transitive repr alignment
* Added padding vec which stores padding required after fields

The main user of this information is rustc_trans::adt::struct_llfields
which determines the LLVM fields to be used by LLVM, including padding
fields.

A possible future optimisation would be to put the padding Vec in an Option, since it will be unused unless you are using repr align.
2017-04-22 11:50:40 +00:00
Cameron Hart
4358e35fda Implementation of repr struct alignment RFC 1358.
The main changes around rustc::ty::Layout::struct and rustc_trans:adt:
* Added primitive_align field which stores alignment before repr align
* Always emit field padding when generating the LLVM struct fields
* Added methods for adjusting field indexes from the layout index to the
  LLVM struct field index

The main user of this information is rustc_trans::adt::struct_llfields
which determines the LLVM fields to be used by LLVM, including padding
fields.
2017-04-21 07:32:32 +10:00
Eduard-Mihai Burtescu
6563374ed2 rustc: replace interior_unsafe with a Freeze trait. 2017-04-20 14:39:31 +03:00
Eduard-Mihai Burtescu
0303a3364b Fix pairs of doubles using an illegal <8 x i8> vector. 2017-04-11 11:33:30 +03:00
Eduard-Mihai Burtescu
f0636b61c7 rustc_trans: use ty::layout for ABI computation instead of LLVM types. 2017-04-09 16:06:56 +03:00
Eduard-Mihai Burtescu
43b227f3bd rustc: add some abstractions to ty::layout for a more concise API. 2017-04-08 23:41:18 +03:00
Eduard-Mihai Burtescu
c977daf97c rustc_trans: avoid sizing_type_of everywhere possible. 2017-04-08 23:40:54 +03:00
Niko Matsakis
6a47fa1d3d remove unneeded & that now fails to coerce
cc https://github.com/rust-lang/rust/issues/40924
2017-03-30 07:55:29 -04:00