about summary refs log tree commit diff
path: root/src/librustc_trans/mir/mod.rs
AgeCommit message (Collapse)AuthorLines
2018-05-17Rename trans to codegen everywhere.Irina Popa-652/+0
2018-05-08Insert fields from TypeAndMut into TyRef to allow layout optimizationJohn Kåre Alsaker-3/+4
2018-05-08Store the GeneratorInterior in the new GeneratorSubstsJohn Kåre Alsaker-4/+5
2018-05-08Store generator movability outside GeneratorInteriorJohn Kåre Alsaker-1/+1
2018-04-26rustc_target: move in cabi_* from rustc_trans.Irina Popa-3/+3
2018-04-18rustc_trans: also check dominators for SSA values in mir::analyze.Eduard-Mihai Burtescu-1/+1
Fixes #50041
2018-03-14remove defaulting to unitAndrew Cann-1/+1
Types will no longer default to `()`, instead always defaulting to `!`. This disables the associated warning and removes the flag from TyTuple
2018-03-13`trans_apply_param_substs` => `subst_and_normalize_erasing_regions`Niko Matsakis-1/+5
Consolidate `trans_apply_param_substs` and `trans_apply_param_substs_env`. Also remove `trans_impl_self_ty`
2018-03-13transition various normalization functions to the new methodsNiko Matsakis-2/+1
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-08Fully use miri in transOliver Schneider-0/+3
2018-02-28rustc: Tweak funclet cleanups of ffi functionsAlex Crichton-6/+54
This commit is targeted at addressing #48251 by specifically fixing a case where a longjmp over Rust frames on MSVC runs cleanups, accidentally running the "abort the program" cleanup as well. Added in #46833 `extern` ABI functions in Rust will abort the process if Rust panics, and currently this is modeled as a normal cleanup like all other destructors. Unfortunately it turns out that `longjmp` on MSVC is implemented with SEH, the same mechanism used to implement panics in Rust. This means that `longjmp` over Rust frames will run Rust cleanups (even though we don't necessarily want it to). Notably this means that if you `longjmp` over a Rust stack frame then that probably means you'll abort the program because one of the cleanups will abort the process. After some discussion on IRC it turns out that `longjmp` doesn't run cleanups for *caught* exceptions, it only runs cleanups for cleanup pads. Using this information this commit tweaks the codegen for an `extern` function to a catch-all clause for exceptions instead of a cleanup block. This catch-all is equivalent to the C++ code: try { foo(); } catch (...) { bar(); } and in fact our codegen here is designed to match exactly what clang emits for that C++ code! With this tweak a longjmp over Rust code will no longer abort the process. A longjmp will continue to "accidentally" run Rust cleanups (destructors) on MSVC. Other non-MSVC platforms will not rust destructors with a longjmp, so we'll probably still recommend "don't have destructors on the stack", but in any case this is a more surgical fix than #48567 and should help us stick to standard personality functions a bit longer.
2018-01-23Let LLVM 5 add DW_OP_deref to indirect args itselfJosh Stone-7/+9
We needed to manually added the `DW_OP_deref` ourselves in earlier LLVM, but starting with [D31439] in LLVM 5, it appears that LLVM will always handle this itself. When we were still adding this manually, the resulting `.debug_loc` had too many derefs, and this failed test `debuginfo/by-value-self-argument-in-trait-impl.rs`. [D31439]: https://reviews.llvm.org/D31439 Fixes #47611. cc @alexcrichton r? @michaelwoerister
2018-01-19Update DW_OP_plus to DW_OP_plus_uconstJosh Stone-1/+1
LLVM <= 4.0 used a non-standard interpretation of `DW_OP_plus`. In the DWARF standard, this adds two items on the expressions stack. LLVM's behavior was more like DWARF's `DW_OP_plus_uconst` -- adding a constant that follows the op. The patch series starting with [D33892] switched to the standard DWARF interpretation, so we need to follow. [D33892]: https://reviews.llvm.org/D33892
2018-01-16Compute LLVM argument indices correctly in face of paddingRobin Kruppe-0/+3
Closes #47278
2018-01-14rustc_trans: rename mircx: MirContext to fx: FunctionCx.Eduard-Mihai Burtescu-24/+24
2018-01-14rustc_trans: rename bcx to bx.Eduard-Mihai Burtescu-50/+50
2018-01-14rustc_trans: rename ccx to cx.Eduard-Mihai Burtescu-21/+21
2018-01-14rustc_trans: rename CrateContext to CodegenCx.Eduard-Mihai Burtescu-4/+4
2018-01-14rustc_trans: access fields directly on CrateContext.Eduard-Mihai Burtescu-1/+1
2017-12-17rustc_trans: always require alignment for load/store/memcpy.Eduard-Mihai Burtescu-3/+3
2017-12-17rustc_trans: always keep track of the Align in LvalueRef.Eduard-Mihai Burtescu-5/+3
2017-12-01MIR: s/lv(al(ue)?)?/place in function/variable/module names.Eduard-Mihai Burtescu-29/+29
2017-12-01MIR: s/Lvalue/Place in type names.Eduard-Mihai Burtescu-14/+14
2017-11-19rustc_trans: support scalar pairs directly in the Rust ABI.Eduard-Mihai Burtescu-49/+49
2017-11-19rustc_trans: restrict "immediate pairs" to pairs of scalars.Eduard-Mihai Burtescu-5/+3
2017-11-19rustc_trans: go through layouts uniformly for fat pointers and variants.Eduard-Mihai Burtescu-27/+8
2017-11-19rustc_trans: query LLVM types from a layout instead of a Ty.Eduard-Mihai Burtescu-2/+2
2017-11-19rustc_trans: keep a layout instead of a type in {Lvalue,Operand}Ref.Eduard-Mihai Burtescu-34/+35
2017-11-19rustc_trans: nest abi::ArgType's for fat pointers instead of eagerly flattening.Eduard-Mihai Burtescu-55/+40
2017-11-19rustc: hide details in Layout in favor of Abi or FieldPlacement.Eduard-Mihai Burtescu-7/+2
2017-11-19rustc: move size/alignment from Layout into layout::Abi.Eduard-Mihai Burtescu-1/+1
2017-11-19rustc: remove Ty::layout and move everything to layout_of.Eduard-Mihai Burtescu-1/+1
2017-11-19rustc: re-complicate the TyLayout API and use better names.Eduard-Mihai Burtescu-1/+1
2017-11-19rustc_trans: remove the in_memory_type_of distinction.Eduard-Mihai Burtescu-1/+1
2017-11-19rustc_trans: use more of the trans::mir and ty::layout APIs throughout.Eduard-Mihai Burtescu-23/+23
2017-11-19rustc_trans: avoid working with sizes/offsets and alignments as integers.Eduard-Mihai Burtescu-6/+5
2017-10-26Avoid unnecessary copies of arguments that are simple bindingsBjörn Steinbrink-2/+12
Initially MIR differentiated between arguments and locals, which introduced a need to add extra copies assigning the argument to a local, even for simple bindings. This differentiation no longer exists, but we're still creating those copies, bloating the MIR and LLVM IR we emit. Additionally, the current approach means that we create debug info for both the incoming argument (marking it as an argument), and then immediately shadow it a local that goes by the same name. This can be confusing when using e.g. "info args" in gdb, or when e.g. a debugger with a GUI displays the function arguments separately from the local variables, especially when the binding is mutable, because the argument doesn't change, while the local variable does.
2017-10-18Avoid unnecessary allocas for indirect function argumentsBjörn Steinbrink-7/+22
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-08-30Make fields of `Span` privateVadim Petrochenkov-5/+5
2017-08-16Merge remote-tracking branch 'origin/master' into genAlex Crichton-9/+9
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-9/+9
Like #43008 (f668999), but _much more aggressive_.
2017-08-14Merge remote-tracking branch 'origin/master' into genAlex Crichton-1/+1
2017-08-12Fix some typosBastien Orivel-1/+1
2017-07-28Fix tidy warningsAlex Crichton-1/+1
2017-07-28Generator literal supportJohn Kåre Alsaker-8/+8
2017-05-28Auto merge of #41917 - arielb1:mir-array, r=nagisabors-18/+32
Translate array drop glue using MIR I was a bit lazy here and used a usize-based index instead of a pointer iteration. Do you think this is important @eddyb? r? @eddyb
2017-05-28fix translation of MSVC funclets that loop to their own startAriel Ben-Yehuda-18/+32
2017-05-27Remove trans-internal re-exports of rustc modulesRobin Kruppe-1/+1
The previous commit removed them from the public API, this rewrites the use statements to get rid of the non-standard re-exports.
2017-04-26Implement a file-path remapping feature in support of debuginfo and ↵Michael Woerister-1/+5
reproducible builds.
2017-04-22Auto merge of #41464 - frewsxcv:rollup, r=frewsxcvbors-3/+4
Rollup of 3 pull requests - Successful merges: #41077, #41355, #41450 - Failed merges: