Andrew Cann
9b15ddb29e
remove defaulting to unit
...
Types will no longer default to `()`, instead always defaulting to `!`.
This disables the associated warning and removes the flag from TyTuple
2018-03-14 12:44:51 +08:00
Niko Matsakis
6288faa3a3
trans_apply_param_substs
=> subst_and_normalize_erasing_regions
...
Consolidate `trans_apply_param_substs` and
`trans_apply_param_substs_env`. Also remove `trans_impl_self_ty`
2018-03-13 11:22:08 -04:00
Niko Matsakis
e4728e494e
transition various normalization functions to the new methods
...
In particular:
- `fully_normalize_monormophic_ty` => `normalize_erasing_regions`
- `normalize_associated_type_in_env` => `normalize_erasing_regions`
- `fully_normalize_associated_types_in` => `normalize_erasing_regions`
- `erase_late_bound_regions_and_normalize` => `normalize_erasing_late_bound_regions`
2018-03-13 11:22:07 -04:00
Oliver Schneider
9857eaa4df
Nuke ConstInt and Const*size
2018-03-08 08:34:10 +01:00
Oliver Schneider
918b6d7633
Produce instead of pointers
2018-03-08 08:08:14 +01:00
Michael Woerister
e5ee01143b
Rename exported_symbol_ids query to something more explicit and document what it is doing.
2018-03-06 09:47:43 +01:00
Michael Woerister
d5ed655a08
Use DefId instead of NodeId while generating debuginfo for statics.
2018-02-19 12:41:10 +01:00
Alex Crichton
4856f07bb5
Rollup merge of #47618 - mrhota:dw_at_noreturn, r=michaelwoerister
...
Teach rustc about DW_AT_noreturn and a few more DIFlags
We achieve two small things with this PR:
1. We provide definitions for a few additional llvm debuginfo flags
1. We _use_ one of these new flags, `FlagNoReturn`, and add it to debuginfo for functions with the never return type (`!`).
2018-01-25 13:49:46 -08:00
John Kåre Alsaker
ccf0d8399e
Adds support for immovable generators. Move checking of invalid borrows across suspension points to borrowck. Fixes #44197 , #45259 and #45093 .
2018-01-23 05:10:38 +01:00
A.J. Gardner
7188706c4f
Teach rustc about DW_AT_noreturn and a few more DIFlags
2018-01-20 18:34:53 -06:00
Eduard-Mihai Burtescu
4e40a0d436
rustc_trans: rename mircx: MirContext to fx: FunctionCx.
2018-01-14 08:56:44 +02:00
Eduard-Mihai Burtescu
209abc71e5
rustc_trans: rename bcx to bx.
2018-01-14 08:56:44 +02:00
Eduard-Mihai Burtescu
e69dacb431
rustc_trans: rename ccx to cx.
2018-01-14 08:56:44 +02:00
Eduard-Mihai Burtescu
fb7de6a041
rustc_trans: rename CrateContext to CodegenCx.
2018-01-14 08:55:57 +02:00
Eduard-Mihai Burtescu
2931af62f0
rustc_trans: access fields directly on CrateContext.
2018-01-14 08:55:43 +02:00
Eduard-Mihai Burtescu
d0d13204a6
rustc_trans: collapse {Local,Shared}CrateContext.
2018-01-14 08:52:16 +02:00
Robin Kruppe
cf3fefe97f
rustc::ty: Rename struct_variant
to non_enum_variant
...
It is also intended for use with unions.
2018-01-08 00:28:05 +01:00
m4b
990a5cc1e5
dwarf: set dwarf linkage_name for fns and statics to its mangled symbol name
2017-12-20 21:28:10 -08:00
bors
df8dfdeff6
Auto merge of #46457 - m4b:no_mangle_static, r=michaelwoerister
...
Don't set the linkage_name for static variables
For `no_mangle` statics:
1. Linkage_name no longer set
2. The static variable also no longer has a dwarf namespace scope
This matches C++ output, which does not set the linkage_name and is not scoped:
e.g. c++:
```
0x000000b6: DW_TAG_base_type [8]
DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000077] = "long int")
DW_AT_encoding [DW_FORM_data1] (DW_ATE_signed)
DW_AT_byte_size [DW_FORM_data1] (0x08)
0x000000bd: DW_TAG_variable [9]
DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000053] = "TEST")
DW_AT_type [DW_FORM_ref4] (cu + 0x0048 => {0x00000048})
DW_AT_external [DW_FORM_flag_present] (true)
DW_AT_decl_file [DW_FORM_data1] ("/home/m4b/tmp/bad_debug/test.cpp")
DW_AT_decl_line [DW_FORM_data1] (14)
DW_AT_location [DW_FORM_exprloc] (<0x9> 03 40 10 20 00 00 00 00 00 )
0x000000d2: DW_TAG_namespace [2] *
DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000009d] = "std")
```
and (now) Rust:
```
0x0000002a: DW_TAG_variable [2]
DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000046] = "TEST")
DW_AT_type [DW_FORM_ref4] (cu + 0x0045 => {0x00000045})
DW_AT_external [DW_FORM_flag_present] (true)
DW_AT_decl_file [DW_FORM_data1] ("/tmp/test.rs")
DW_AT_decl_line [DW_FORM_data1] (8)
DW_AT_alignment [DW_FORM_udata] (1)
DW_AT_location [DW_FORM_exprloc] (<0x9> 03 c0 4d 06 00 00 00 00 00 )
0x00000040: DW_TAG_namespace [3] *
DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000004b] = "test")
```
2017-12-20 12:03:25 +00:00
m4b
500dc14b21
dwarf: do not set linkage_name for no mangle statics, and do not have a scope. ref #33172
2017-12-19 21:18:24 -08:00
Ariel Ben-Yehuda
f6fcfa3915
normalize the results of tcx.type_of
after substituting
...
Also remove `def_ty`, which was a footgun because it did not do the
above.
2017-12-18 17:08:50 +02:00
Maik Klein
116e43f73b
Prefer type_of().substs over instance::ty()
2017-12-18 17:08:49 +02:00
Maik Klein
1df6f8321b
Remove duplicated functions from trans::common.rs
2017-12-18 17:08:49 +02:00
Oliver Schneider
d732da813b
Use PathBuf instead of String where applicable
2017-12-14 11:22:08 +01:00
Eduard-Mihai Burtescu
8437d7c0f1
rustc: extend the niche-filling enum optimization past 2 variants.
2017-11-19 02:43:56 +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
b203a26efb
rustc: generalize layout::Variants::NicheFilling to niches other than 0.
2017-11-19 02:14:33 +02:00
Eduard-Mihai Burtescu
018323ffc2
rustc: collapse the remains of Layout into Variants (enums vs everything else).
2017-11-19 02:14:32 +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
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
b2d52d2132
rustc: do not pub use Layout::* in layout.
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
ed788a62f6
rustc: store CachedLayout for each variant of enum Layout's instead of Struct.
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
bd86f3739e
rustc: make Layout::NullablePointer a lot more like Layout::General.
2017-11-19 02:14:30 +02:00
Eduard-Mihai Burtescu
33a205b56f
rustc: collapse Layout::CEnum into Layout::General.
2017-11-19 02:14:30 +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
02276e9f49
rustc: collapse Layout::{Raw,StructWrapped}NullablePointer into one variant.
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
aa811d728a
rustc: remove source field path from Layout::StructWrappedNullablePointer.
2017-11-19 02:14:29 +02:00
Eduard-Mihai Burtescu
50a3fd0097
rustc: remove useless 0 prefix from Layout::StructWrappedNullablePointer's discrfield.
2017-11-19 02:14:29 +02:00
Eduard-Mihai Burtescu
44eef7c9ac
rustc: do not inject discriminant fields into Layout::General's variants.
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