about summary refs log tree commit diff
path: root/src/librustc_codegen_ssa/traits
AgeCommit message (Collapse)AuthorLines
2019-10-13Remove MiscMethods::instancesbjorn3-2/+2
2019-10-13s/FuncId/Functionbjorn3-9/+9
2019-10-13Remove is_const_integral method from ConstMethodsbjorn3-3/+1
2019-10-13Introduce FuncId backend typebjorn3-7/+10
2019-10-10Auto merge of #59546 - sfanxiang:interminable-ub, r=nagisabors-0/+1
Add llvm.sideeffect to potential infinite loops and recursions LLVM assumes that a thread will eventually cause side effect. This is not true in Rust if a loop or recursion does nothing in its body, causing undefined behavior even in common cases like `loop {}`. Inserting llvm.sideeffect fixes the undefined behavior. As a micro-optimization, only insert llvm.sideeffect when jumping back in blocks or calling a function. A patch for LLVM is expected to allow empty non-terminate code by default and fix this issue from LLVM side. https://github.com/rust-lang/rust/issues/28728 **UPDATE:** [Mentoring instructions here](https://github.com/rust-lang/rust/pull/59546#issuecomment-515072429) to unstall this PR
2019-09-29remove indexed_vec re-export from rustc_data_structurescsmoe-1/+1
2019-09-28Add llvm.sideeffect to potential infinite loops and recursionsXiang Fan-0/+1
LLVM assumes that a thread will eventually cause side effect. This is not true in Rust if a loop or recursion does nothing in its body, causing undefined behavior even in common cases like `loop {}`. Inserting llvm.sideeffect fixes the undefined behavior. As a micro-optimization, only insert llvm.sideeffect when jumping back in blocks or calling a function. A patch for LLVM is expected to allow empty non-terminate code by default and fix this issue from LLVM side. https://github.com/rust-lang/rust/issues/28728
2019-09-26Rollup merge of #64772 - Mark-Simulacrum:no-tyctxt-tx, r=eddybMazdak Farrokhzad-1/+7
Remove tx_to_llvm_workers from TyCtxt This can be kept within the codegen backend crates entirely -- there's no reason for us to create it outside and attempt to hold it in the (global) context. Changes here aren't really too easily reviewable I suspect -- not sure if they can be cleaned up by splitting into more commits though, it's just hard to reason about `Box<Any>` in general. If there are thoughts though I'd be happy to hear them. The primary goal of this PR is to get rid of the field on `rustc_interface::Queries`.
2019-09-25Remove tx_to_llvm_workers from TyCtxtMark Rousskov-1/+7
This can be kept within the codegen backend crates entirely
2019-09-25Rename `sty` to `kind`varkor-1/+1
2019-09-17Get rid of special const intrinsic query in favour of `const_eval`Oliver Scherer-2/+2
2019-09-12codegen: be more explicit about setting giving names to allocas.Eduard-Mihai Burtescu-3/+2
2019-09-06rustc_codegen_llvm: give names to non-alloca variable values.Eduard-Mihai Burtescu-1/+1
2019-09-04Remove `LocalInternedString` uses from `librustc_codegen_llvm`.Nicholas Nethercote-3/+3
2019-08-17Remove SyntaxContext from {ast, hir}::{GlobalAsm, InlineAsm}Matthew Jasper-0/+2
We now store it in the `Span` of the expression or item.
2019-08-02CTFE: simplify Value type by not checking for alignmentRalf Jung-1/+0
2019-07-24Merge `rustc_allocator` into `libsyntax_ext`Vadim Petrochenkov-1/+1
2019-07-12Replace `struct_tail` and `struct_lockstep_tails` with variants handling ↵Felix S. Klock II-2/+3
normalization. The old struct tail functions did not deal with `<T as Trait>::A` and `impl Trait`, at least not explicitly. (We didn't notice this bug before because it is only exposed when the tail (post deep normalization) is not `Sized`, so it was a rare case to deal with.) For post type-checking (i.e. during codegen), there is now `struct_tail_erasing_lifetimes` and `struct_lockstep_tails_erasing_lifetimes`, which each take an additional `ParamEnv` argument to drive normalization. For pre type-checking cases where normalization is not needed, there is `struct_tail_without_normalization`. (Currently, the only instance of this is `Expectation::rvalue_hint`.) All of these new entrypoints work by calling out to common helper routines. The helpers are parameterized over a closure that handles the normalization.
2019-07-09Fix float add/mul reduction codegenNikita Popov-0/+1
The accumulator is now respected for unordered reductions.
2019-07-03Remove needless lifetimesJeremy Stucki-2/+2
2019-06-19Weave the alignment through `ByRef`Oliver Scherer-0/+1
2019-06-18Auto merge of #59625 - immunant:copy_variadics_typealias, r=eddybbors-2/+2
Refactor C FFI variadics to more closely match their C counterparts, and add Clone implementation We had to make some changes to expose `va_copy` and `va_end` directly to users (mainly for C2Rust, but not exclusively): - redefine the Rust variadic structures to more closely correspond to C: `VaList` now matches `va_list`, and `VaListImpl` matches `__va_list_tag` - add `Clone` for `VaListImpl` - add explicit `as_va_list()` conversion function from `VaListImpl` to `VaList` - add deref coercion from `VaList` to `VaListImpl` - add support for the `asmjs` target All these changes were needed for use cases like: ```Rust let mut ap2 = va_copy(ap); vprintf(fmt, ap2); va_end(&mut ap2); ```
2019-06-18rustc: remove unused lifetimes.Eduard-Mihai Burtescu-1/+1
2019-06-18rustc: remove 'x: 'y bounds (except from comments/strings).Eduard-Mihai Burtescu-2/+2
2019-06-17Expose `VaListImpl` as the Rust equivalent of `__va_list_tag` and implement ↵Andrei Homescu-2/+2
Clone for it.
2019-06-14Unify all uses of 'gcx and 'tcx.Eduard-Mihai Burtescu-6/+6
2019-06-12Run `rustfmt --file-lines ...` for changes from previous commits.Eduard-Mihai Burtescu-6/+2
2019-06-12rustc: replace `TyCtxt<'tcx, 'gcx, 'tcx>` with `TyCtxt<'gcx, 'tcx>`.Eduard-Mihai Burtescu-4/+4
2019-06-12Fix fallout from `deny(unused_lifetimes)`.Eduard-Mihai Burtescu-2/+2
2019-06-12rustc: replace `TyCtxt<'a, 'gcx, 'tcx>` with `TyCtxt<'tcx, 'gcx, 'tcx>`.Eduard-Mihai Burtescu-3/+3
2019-06-11rustc_codegen_*: deny(unused_lifetimes).Eduard-Mihai Burtescu-6/+6
2019-06-03Auto merge of #59148 - lcnr:unchecked_maths, r=eddybbors-0/+6
add support for unchecked math add compiler support for ```rust /// Returns the result of an unchecked addition, resulting in /// undefined behavior when `x + y > T::max_value()` or `x + y < T::min_value()`. pub fn unchecked_add<T>(x: T, y: T) -> T; /// Returns the result of an unchecked substraction, resulting in /// undefined behavior when `x - y > T::max_value()` or `x - y < T::min_value()`. pub fn unchecked_sub<T>(x: T, y: T) -> T; /// Returns the result of an unchecked multiplication, resulting in /// undefined behavior when `x * y > T::max_value()` or `x * y < T::min_value()`. pub fn unchecked_mul<T>(x: T, y: T) -> T; ``` cc https://github.com/rust-lang/rfcs/issues/2508
2019-06-03add support for unchecked mathlcnr/Bastian Kauschke-0/+6
2019-06-02remove reexports of mir::mono::{MonoItem,CodegenUnit}Mark Mansi-1/+1
2019-06-02remove reexport of rustc::ty::InstanceMark Mansi-4/+2
2019-05-29Rollup merge of #61297 - eddyb:forsaken-stats, r=nagisaMazdak Farrokhzad-5/+1
Remove LLVM instruction stats and other (obsolete) codegen stats. Both `-Z count_llvm_insns` and `-Z codegen-stats` are removed, as (AFAIK) they have been of little use in the last few years, especially after the transition to MIR->LLVM codegen. Other than for the LLVM instruction counts, `-Z codegen-stats` has long been obsoleted anyway. r? @nagisa cc @rust-lang/compiler
2019-05-29rustc_codegen_llvm: remove LLVM instruction count stats.Eduard-Mihai Burtescu-5/+1
2019-05-28Changes the type `mir::Mir` into `mir::Body`Claude-Alban RANÉLY-VERGÉ-DÉPRÉ-2/+2
The commit should have changed comments as well. At the time of writting, it passes the tidy and check tool. Revisions asked by eddyb : - Renamed of all the occurences of {visit/super}_mir - Renamed test structures `CachedMir` to `Cached` Fixing the missing import on `AggregateKind`
2019-05-14removes `AbiMethods`Saleem Jaffer-11/+10
2019-05-05code review fixesSaleem Jaffer-2/+1
2019-05-04adding HasParamEnv traitSaleem Jaffer-2/+9
2019-04-30Move metadata encoding earlier.Nicholas Nethercote-3/+4
This commit separates metadata encoding (`tcx.encode_metadata`) from the creation of the metadata module (which is now handled by `write_compressed_metadata`, formerly `write_metadata`). The metadata encoding now occurs slightly earlier in the pipeline, at the very start of code generation within `start_codegen`. Metadata *writing* still occurs near the end of compilation; that will be moved forward in subsequent commits.
2019-04-23rustc_codegen_ssa: rename debuginfo_upvar_decls_ops_sequence to ↵Eduard-Mihai Burtescu-1/+1
debuginfo_upvar_ops_sequence.
2019-03-31Remove redundant importFabian Drinck-1/+0
2019-03-29Use ExactSizeIterator + TrustedLen instead of num_cases arg for switchbjorn3-2/+2
2019-03-29Add a method for emiting a switch.bjorn3-2/+3
2019-03-29Remove inline_asm_call from cg_ssabjorn3-14/+0
`count_insn` is no longer called for inline asm, because it is private to builder.rs
2019-03-29Remove type_variadic_func and typ_array from cg_ssabjorn3-9/+8
2019-03-29Remove a lot of methods from *TypeMethodsbjorn3-64/+6
2019-03-29Remove scalar_lltypes from cg_ssabjorn3-3/+0