Mark Simulacrum
a9b5c63d43
Move eh_unwind_resume into CrateContext
...
Also improves cache quality.
2016-12-20 20:04:46 -07:00
Mark Simulacrum
654131cb53
Add unreachable() after calls to eh_unwind_resume.
2016-12-20 20:04:45 -07:00
Mark Simulacrum
57914f626b
Move eh_personality() onto CrateContext
2016-12-20 20:04:45 -07:00
Mark Simulacrum
bd009dc444
Remove fn_ty from FunctionContext
2016-12-20 20:04:44 -07:00
Mark Simulacrum
6fac0a1a84
Change *.fcx.ccx to *.ccx
2016-12-20 20:04:43 -07:00
Mark Simulacrum
88202c5b83
Replace bcx.ccx() with bcx.ccx
2016-12-20 20:04:41 -07:00
Mark Simulacrum
f11721a13e
Add helper function to set debug locations
2016-12-20 20:03:35 -07:00
Mark Simulacrum
22bf541e27
Clean up uses of set_personality_fn.
...
Remove gnu/msvc constructors for Funclet; these are worse for
readability than explicit Some/None.
2016-12-20 20:03:35 -07:00
Mark Simulacrum
7f5dffbb19
Make debuginfo take debug_context instead of MirContext
2016-12-20 20:03:34 -07:00
Mark Simulacrum
2bda3b7acb
Inline and simplify init_cpad
2016-12-20 20:03:33 -07:00
Mark Simulacrum
e10695f161
Move param_substs onto MirContext
2016-12-20 20:03:32 -07:00
Mark Simulacrum
a42a3429fe
Move param_env onto SharedCrateContext, and move functions which need the ParamEnv onto it.
2016-12-20 20:03:32 -07:00
Mark Simulacrum
2b9a0efef4
Move debug_context to MirContext from FunctionContext
2016-12-20 20:03:32 -07:00
Mark Simulacrum
b48e74b5b0
Rename 'blk and 'bcx to 'a
2016-12-20 20:03:31 -07:00
Mark-Simulacrum
1804131b6d
Remove Ref::clone for MirContext mir
2016-12-20 20:03:30 -07:00
Mark-Simulacrum
bf8614b55a
Rename Builder::alloca to dynamic_alloca
2016-12-20 20:03:27 -07:00
Mark-Simulacrum
820164582d
Remove DebugLoc.
2016-12-20 20:03:24 -07:00
Mark-Simulacrum
5bdcc22b79
Remove FIXME
2016-12-20 20:02:52 -07:00
Mark-Simulacrum
86b2bdb435
Rename LandingPad to Funclet
...
Changes internal storage to direct field values instead of Options,
since both fields are always either set or not set.
2016-12-20 20:02:48 -07:00
Mark-Simulacrum
8f3d824cc7
Remove common::Block.
2016-12-20 20:02:46 -07:00
Mark-Simulacrum
ad0a901d37
Remove *_builder
2016-12-20 20:01:40 -07:00
Mark-Simulacrum
59ef51c12a
Replace build.rs with calling functions on builder directly
2016-12-20 20:01:40 -07:00
Mark-Simulacrum
bf7d4534a7
Refactor Block into BlockAndBuilder
2016-12-20 20:01:40 -07:00
Austin Hicks
c8c3579bff
Fix closure arguments which are immediate because of field reordering.
...
While building immediates goes through type_of::type_of, extracting them must account for field reorderings.
2016-12-14 12:28:24 -05:00
Mark-Simulacrum
1eab19dba8
Refactor ty::FnSig to privatize all fields
2016-12-05 22:22:49 -07:00
bors
ebec55406b
Auto merge of #37824 - jseyfried:symbols, r=eddyb
...
Clean up `ast::Attribute`, `ast::CrateConfig`, and string interning
This PR
- removes `ast::Attribute_` (changing `Attribute` from `Spanned<Attribute_>` to a struct),
- moves a `MetaItem`'s name from the `MetaItemKind` variants to a field of `MetaItem`,
- avoids needlessly wrapping `ast::MetaItem` with `P`,
- moves string interning into `syntax::symbol` (`ast::Name` is a reexport of `symbol::Symbol` for now),
- replaces `InternedString` with `Symbol` in the AST, HIR, and various other places, and
- refactors `ast::CrateConfig` from a `Vec` to a `HashSet`.
r? @eddyb
2016-11-21 08:08:47 -06:00
Jeffrey Seyfried
e85a0d70b8
Use Symbol
instead of InternedString
in the AST, HIR, and various other places.
2016-11-21 09:00:55 +00:00
Jeffrey Seyfried
d2f8fb0a0a
Move syntax::util::interner
-> syntax::symbol
, cleanup.
2016-11-20 23:40:20 +00:00
Dylan McKay
84415ea1f2
[LLVM 4.0] Set EH personality when resuming stack unwinding
...
To resume stack unwinding, the LLVM `resume` instruction must be used.
In order to use this instruction, the calling function must have an
exception handling personality set.
LLVM 4.0 adds a new IR validation check to ensure a personality is
always set in these cases.
This was introduced in [r277360](https://reviews.llvm.org/rL277360 ).
2016-11-18 11:24:19 -05:00
Nicholas Nethercote
00e48affde
Replace FnvHasher use with FxHasher.
...
This speeds up compilation by 3--6% across most of rustc-benchmarks.
2016-11-08 15:14:59 +11:00
Simonas Kazlauskas
8ec0b3a12a
Do not clone Mir unnecessarily
2016-10-31 02:16:21 +02:00
Eduard Burtescu
36340ba994
rustc: move mir::repr::* to mir.
2016-10-28 10:37:24 +03:00
Ariel Ben-Yehuda
ee338c31fe
normalize types every time HR regions are erased
...
Associated type normalization is inhibited by higher-ranked regions.
Therefore, every time we erase them, we must re-normalize.
I was meaning to introduce this change some time ago, but we used
to erase regions in generic context, which broke this terribly (because
you can't always normalize in a generic context). That seems to be gone
now.
Ensure this by having a `erase_late_bound_regions_and_normalize`
function.
Fixes #37109 (the missing call was in mir::block).
2016-10-13 19:17:53 +03:00
Ariel Ben-Yehuda
6d54e0eb6b
emit !nonnull metadata on loaded fat pointers when possible
...
cc #36920 (in addition to LLVM PR30597, should fix the &&[i32] case)
2016-10-05 13:58:04 +03:00
Jonas Schievink
393db2d830
[WIP] Move MIR towards a single kind of local
2016-09-26 20:41:54 +02:00
Austin Hicks
f16068e577
Completely kill represent_type
and the adt::Repr
type that goes with it.
2016-09-24 18:21:10 -04:00
Niko Matsakis
b49a26ec6f
invoke drop glue with a ptr to (data, meta)
...
This is done by creating a little space on the stack. Hokey, but it's
the simplest fix I can see.
2016-09-13 16:05:12 -04:00
Vadim Petrochenkov
e05e74ac83
Replace _, _
with ..
2016-09-04 12:30:33 +03:00
Eduard Burtescu
d0654ae5e5
rustc_trans: remove the bulk of old trans and most of its support code.
2016-08-24 13:23:37 +03:00
Andrew Cann
ed02344fbc
Remove obsolete divergence related stuff
...
Replace FnOutput with Ty
Replace FnConverging(ty) with ty
Purge FnDiverging, FunctionRetTy::NoReturn and FunctionRetTy::None
2016-08-13 21:37:09 +08:00
Scott A Carr
9f8093856d
refactor other type methods
2016-08-08 13:35:10 -07:00
Scott A Carr
28abc0a6aa
refactor lvalue_ty to be method of lvalue
2016-08-05 15:59:51 -07:00
Eduard Burtescu
fbabe61641
rustc_trans: don't Assert(Overflow(Neg)) when overflow checks are off.
2016-08-04 19:57:57 +03:00
Eduard Burtescu
d1f341dd91
rustc_trans: apply the debug location for the MIR Assert panic call.
2016-07-31 22:17:29 +03:00
Eduard Burtescu
7279af86c8
trans: generalize immediate temporaries to all MIR locals.
2016-06-20 23:55:14 +03:00
Eduard Burtescu
bec32eb4ff
trans: noop drops don't need their lvalue in an alloca.
2016-06-20 23:18:21 +03:00
Ariel Ben-Yehuda
798be90648
introduce an unreachable
terminator
...
Use it instead of a `panic` for inexhaustive matches and correct the
comment. I think we trust our match-generation algorithm enough to
generate these blocks, and not generating an `unreachable` means that
LLVM won't optimize `match void() {}` to an `unreachable`.
2016-06-09 15:16:15 +03:00
Ariel Ben-Yehuda
e3af9fa490
make the basic_blocks field private
2016-06-09 14:55:19 +03:00
Ariel Ben-Yehuda
bc1eb67721
introduce the type-safe IdxVec and use it instead of loose indexes
2016-06-09 14:26:08 +03:00
bors
bb4b3fb7f9
Auto merge of #32202 - arielb1:slice-patterns, r=nikomatsakis
...
Implement RFC495 semantics for slice patterns
non-MIR translation is still not supported for these and will happily ICE.
This is a [breaking-change] for many uses of slice_patterns.
[RFC 495 text](https://github.com/rust-lang/rfcs/blob/master/text/0495-array-pattern-changes.md )
2016-06-08 19:30:33 -07:00