about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/mir/place.rs
AgeCommit message (Collapse)AuthorLines
2018-11-16Great separation of librustc_codegen_llvm: librustc_codegen_ssa compilesDenis Merigoux-497/+0
2018-11-16Beginning of moving all backend-agnostic code to rustc_codegen_ssaDenis Merigoux-1/+1
2018-11-16Starting to move backend-agnostic code into codegen_utilsDenis Merigoux-1/+1
IntPredicate moved
2018-11-16Generalized mir::codegen_mir (and all subsequent functions)Denis Merigoux-69/+61
2018-11-16Generalized base::coerce_unsized_intoDenis Merigoux-73/+14
2018-11-16Generalized base::unsized_infoDenis Merigoux-1/+1
2018-11-16Traitified IntrinsicCallMethodsDenis Merigoux-4/+1
2018-11-16Transfered memcpy and memset to BuilderMethodsDenis Merigoux-7/+2
2018-11-16Added StaticMethods traitDenis Merigoux-5/+5
2018-11-16Generalized memset and memcpyDenis Merigoux-1/+3
2018-11-16Removing LLVM content from CommonMethods -> ConstMethodsDenis Merigoux-1/+1
2018-11-16Prefixed type methods & removed trait impl for write::CodegenContextDenis Merigoux-10/+15
2018-11-16Prefixed const methods with "const" instead of "c"Denis Merigoux-25/+25
2018-11-16Traitification of type_ methodsDenis Merigoux-12/+11
The methods are now attached to CodegenCx instead of Type
2018-11-16Added self argument for Codegen CommonMethod trait methodsDenis Merigoux-25/+25
2018-11-16Replaced Codegen field access by trait methodDenis Merigoux-37/+37
2018-11-16Traitification of common.rs methodsDenis Merigoux-29/+30
2018-11-16New files and folders for traitsDenis Merigoux-2/+2
Moved common enums to common
2018-11-16Removed genericity over Value in various functionsDenis Merigoux-1/+1
Prelude to using associated types in traits rather than type parameters
2018-11-16Generalized IntPredicate in the BuilderMethods traitDenis Merigoux-3/+3
2018-11-16Generalized base.rs#call_memcpy and everything that it usesDenis Merigoux-1/+7
Generalized operand.rs#nontemporal_store and fixed tidy issues Generalized operand.rs#nontemporal_store's implem even more With a BuilderMethod trait implemented by Builder for LLVM Cleaned builder.rs : no more code duplication, no more ValueTrait Full traitification of builder.rs
2018-11-16Reduced line length to pass tidyDenis Merigoux-1/+1
Generalized FunctionCx Added ValueTrait and first change Generalize CondegenCx Generalized the Builder struct defined in librustc_codegen_llvm/builder.rs
2018-11-16rustc_codegen_llvm: begin generalizing over backend values.Irina Popa-14/+21
2018-11-12Use type safe `VariantIdx` instead of `usize` everywhereOliver Scherer-10/+11
2018-10-26Add the actual chain of projections to `UserTypeProjection`.Felix S. Klock II-1/+2
Update the existing NLL `patterns.rs` test accordingly. includes changes addressing review feedback: * Added example to docs for `UserTypeProjections` illustrating how we build up multiple projections when descending into a pattern with type ascriptions. * Adapted niko's suggested docs for `UserTypeProjection`. * Factored out `projection_ty` from more general `projection_ty_core` (as a drive-by, made its callback an `FnMut`, as I discovered later that I need that). * Add note to docs that `PlaceTy.field_ty(..)` does not normalize its result. * Normalize as we project out `field_ty`.
2018-09-30use is_uninhabited in more placesJorge Aparicio-2/+2
2018-09-29Revert "Auto merge of #53508 - japaric:maybe-uninit, r=RalfJung"Ralf Jung-2/+2
This reverts commit c6e3d7fa3113aaa64602507f39d4627c427742ff, reversing changes made to 4591a245c7eec9f70d668982b1383cd2a6854af5.
2018-09-24Rely only on base alignment and offset for computing field alignmentColin Pronovost-4/+1
Fix #54028
2018-09-22use is_uninhabited in more placesJorge Aparicio-2/+2
2018-09-09Auto merge of #53998 - eddyb:issue-53728, r=oli-obkbors-3/+6
rustc_codegen_llvm: don't assume offsets are always aligned. Fixes #53728 by taking into account not just overall type alignment and the field's alignment when determining whether a field is aligned or not ("packed"), but also the field's offset within the type. Previously, rustc assumed that the offset was always at least as aligned as `min(struct.align, field.align)`. However, there's no real reason to have that assumption, and it obviously can't always be true after we implement `#[repr(align(N), pack(K))]`. There's also a case today where that assumption is not true, involving niche discriminants in enums: Suppose that we have the code in #53728: ```Rust #[repr(u16)] enum DeviceKind { Nil = 0, } #[repr(packed)] struct DeviceInfo { endianness: u8, device_kind: DeviceKind, } struct Wrapper { device_info: DeviceInfo, data: u32 } ``` Observe the layout of `Option<Wrapper>`. It has an alignment of 4 because of the `u32`. `device_info.device_kind` is a good niche field to use, which means the enum ends up with this layout: ``` size = 8 align = 4 fields = [ { offset=1, type=u16 } // discriminant, .<Some>.device_info.device_kind ] ``` And here we have an discriminant with alignment 2 (`u16`) but offset 1.
2018-09-07make field always private, add `From` implsNiko Matsakis-1/+0
2018-09-06rustc_codegen_llvm: don't assume offsets are always aligned.Eduard-Mihai Burtescu-3/+6
2018-08-27Miri Memory WorkRalf Jung-1/+1
* Unify the two maps in memory to store the allocation and its kind together. * Share the handling of statics between CTFE and miri: The miri engine always uses "lazy" `AllocType::Static` when encountering a static. Acessing that static invokes CTFE (no matter the machine). The machine only has any influence when writing to a static, which CTFE outright rejects (but miri makes a copy-on-write). * Add an `AllocId` to by-ref consts so miri can use them as operands without making copies. * Move responsibilities around for the `eval_fn_call` machine hook: The hook just has to find the MIR (or entirely take care of everything); pushing the new stack frame is taken care of by the miri engine. * Expose the intrinsics and lang items implemented by CTFE so miri does not have to reimplement them.
2018-08-22Remove Ty prefix from Ty{Bool|Char|Int|Uint|Float|Str}varkor-1/+1
2018-08-22Remove Ty prefix from Ty{Foreign|Param}varkor-1/+1
2018-08-22Remove Ty prefix from ↵varkor-2/+2
Ty{Adt|Array|Slice|RawPtr|Ref|FnDef|FnPtr|Dynamic|Closure|Generator|GeneratorWitness|Never|Tuple|Projection|Anon|Infer|Error}
2018-08-19Integrate OperandValue::UnsizedRef into OperandValue::Ref.Masaki Hara-2/+2
2018-08-19Implement simple codegen for unsized rvalues.Masaki Hara-2/+19
2018-07-31Make globals with private linkage unnamed. Fixes #50862.Colin Pronovost-1/+1
2018-07-30rustc_codegen_llvm: use safe references for Value.Irina Popa-44/+37
2018-07-30rustc_codegen_llvm: use safe references for Type.Irina Popa-12/+12
2018-07-30rustc_codegen_llvm: move from empty enums to extern types.Irina Popa-6/+4
2018-07-23Fix tidyOliver Schneider-1/+2
2018-07-23Promoteds are statics and statics have a place, not just a valueOliver Schneider-2/+46
2018-07-05Update scalar pairs per review commentsJosh Stone-5/+1
2018-07-05Store scalar pair bools as i8 in memoryJosh Stone-3/+3
We represent `bool` as `i1` in a `ScalarPair`, unlike other aggregates, to optimize IR for checked operators and the like. With this patch, we still do so when the pair is an immediate value, but we use the `i8` memory type when the value is loaded or stored as an LLVM aggregate. So `(bool, bool)` looks like an `{ i1, i1 }` immediate, but `{ i8, i8 }` in memory. When a pair is a direct function argument, `PassMode::Pair`, it is still passed using the immediate `i1` type, but as a return value it will use the `i8` memory type. Also, `bool`-like` enum tags will now use scalar pairs when possible, where they were previously excluded due to optimization issues.
2018-06-16rustc_codegen_llvm: don't treat i1 as signed, even for #[repr(i8)] enums.Eduard-Mihai Burtescu-1/+5
2018-05-17Rename trans to codegen everywhere.Irina Popa-0/+498