about summary refs log tree commit diff
path: root/src/librustc_codegen_ssa
AgeCommit message (Collapse)AuthorLines
2019-11-14Auto merge of #66233 - cjgillot:constkind, r=oli-obkbors-8/+10
Split ConstValue into two enums Hello, Issue #59210 appeared abandoned, so I gave it a go. Some further cleanup and refactoring may be mandated. I did not test beyond `x.py check`, since my home computer dies compiling librustc. Fixes #59210
2019-11-13Rollup merge of #66335 - Mark-Simulacrum:self-profile-to-data, ↵Yuki Okushi-1/+1
r=michaelwoerister Move self-profile infrastructure to data structures The single dependency on queries (QueryName) can be fairly easily abstracted via a trait and this further decouples Session from librustc (the primary goal). This is intended as a precursor to moving Session out of librustc, but since that involves lots of smaller steps that move around code I'm splitting it up into separate PRs.
2019-11-13Rollup merge of #66334 - Mark-Simulacrum:sess-cstore, r=petrochenkovYuki Okushi-2/+2
Move Session fields to CrateStore `allocator_kind` and `injected_panic_runtime` are both query-like, this moves them out of Session and into CrateStore, avoiding the `Once` they previously had by clearing separating initialization and de-initialization.
2019-11-12Fix tidy.Camille GILLOT-1/+3
2019-11-12Rename in librustc_codegen_ssa.Camille GILLOT-8/+8
2019-11-12Move self-profile infrastructure to data structuresMark Rousskov-1/+1
The single dependency on queries (QueryName) can be fairly easily abstracted via a trait and this further decouples Session from librustc (the primary goal).
2019-11-11Add more detailed codegen commentAaron Hill-0/+5
2019-11-11Fix up intrinsic implementationAaron Hill-0/+10
2019-11-11Move allocator_kind to CrateStoreMark Rousskov-2/+2
Similarly to the previous commit, there's no need for this to be in Session and have a Once around it.
2019-11-10Merge hir::Mutability into ast::Mutability.Camille GILLOT-2/+2
2019-11-10Rollup merge of #66235 - eddyb:coff-syrup, r=nagisaYuki Okushi-1/+2
rustc_metadata: don't let LLVM confuse rmeta blobs for COFF object files. This has likely been a silent issue since 1.10 but only caused trouble recently (see https://github.com/rust-lang/rust/issues/65536#issuecomment-552018224), when recent changes to the `rmeta` schema introduced more opportunities for COFF parse errors. To prevent any undesired interactions with old compilers, I've renamed the file inside `rlib`s from `rust.metadata.bin` to `lib.rmeta` (not strongly attached to it, suggestions welcome). Fixes #65536. <hr/> Before: ``` $ llvm-objdump -all-headers build/*/stage1-std/*/release/deps/libcore-*.rmeta build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/libcore-6b9e8b5a59b79a1d.rmeta: file format COFF-<unknown arch> architecture: unknown start address: 0x00000000 Sections: Idx Name Size VMA Type SYMBOL TABLE: ``` After: ``` $ llvm-objdump -all-headers build/*/stage1-std/*/release/deps/libcore-*.rmeta llvm-objdump: error: 'build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/libcore-6b9e8b5a59b79a1d.rmeta': The file was not recognized as a valid object file ```
2019-11-10Rollup merge of #65831 - matthewjasper:array-ptr-cast, r=oli-obkYuki Okushi-0/+1
Don't cast directly from &[T; N] to *const T Split out from #64588 r? @oli-obk
2019-11-09rustc_metadata: don't let LLVM confuse rmeta blobs for COFF object files.Eduard-Mihai Burtescu-1/+2
2019-11-07Rollup merge of #65884 - Centril:non-hardcoded-abis, r=petrochenkovMazdak Farrokhzad-3/+3
syntax: ABI-oblivious grammar This PR has the following effects: 1. `extern $lit` is now legal where `$lit:literal` and `$lit` is substituted for a string literal. 2. `extern "abi_that_does_not_exist"` is now *syntactically* legal whereas before, the set of ABI strings was hard-coded into the grammar of the language. With this PR, the set of ABIs are instead validated and translated during lowering. That seems more appropriate. 3. `ast::FloatTy` is now distinct from `rustc_target::abi::FloatTy`. The former is used substantially more and the translation between them is only necessary in a single place. 4. As a result of 2-3, libsyntax no longer depends on librustc_target, which should improve pipe-lining somewhat. cc @rust-lang/lang -- the points 1-2 slightly change the definition of the language but in a way which seems consistent with our general principles (in particular wrt. the discussions of turning things into semantic errors). I expect this to be uncontroversial but it's worth letting y'all know. :) r? @varkor
2019-11-07syntax: use distinct FloatTy from rustc_target.Mazdak Farrokhzad-3/+3
We also sever syntax's dependency on rustc_target as a result. This should slightly improve pipe-lining. Moreover, some cleanup is done in related code.
2019-11-06review commentsEsteban Küber-6/+2
2019-11-06Rollup merge of #65973 - eddyb:caller-location-panic, r=petrochenkovMazdak Farrokhzad-1/+2
caller_location: point to macro invocation sites, like file!/line!, and use in core::panic!. The main change here is to `core::panic!`, trying to fix this remaining regression: https://github.com/rust-lang/rust/pull/65927#issuecomment-547625147 However, in order for `caller_location` to be usable from macros the same way `file!()`/`line!()` are, it needs to have the same behavior (of extracting the macro invocation site `Span` and using that). Arguably we would've had to do this at some point anyway, if we want to use `#[track_caller]` to replace the `file!()`/`line!()` uses from macros, but I'm not sure the RFC mentions this at all. r? @petrochenkov cc @anp @nnethercote
2019-11-06Rollup merge of #65776 - nnethercote:rename-LocalInternedString-and-more, ↵Mazdak Farrokhzad-8/+6
r=estebank Rename `LocalInternedString` and more This PR renames `LocalInternedString` as `SymbolStr`, removes an unnecessary `impl` from it, improves comments, and cleans up some `SymbolStr` uses. r? @estebank
2019-11-03rustc_codegen_ssa: rename ArgTypeMethods to ArgAbiMethods.Eduard-Mihai Burtescu-4/+4
2019-11-03rustc: rename {Fn,Arg}TypeExt to {Fn,Arg}AbiExt.Eduard-Mihai Burtescu-2/+2
2019-11-03rustc_target: rename {Fn,Arg}Type to {Fn,Arg}Abi.Eduard-Mihai Burtescu-69/+69
2019-11-02Remove the `AsRef` impl for `SymbolStr`.Nicholas Nethercote-1/+1
Because it's highly magical, which goes against the goal of keeping `SymbolStr` simple. Plus it's only used in a handful of places that only require minor changes.
2019-11-02Simplify various `Symbol` use points.Nicholas Nethercote-3/+3
Including removing a bunch of unnecessary `.as_str()` calls, and a bunch of unnecessary sigils.
2019-11-02Convert `x.as_str().to_string()` to `x.to_string()` where possible.Nicholas Nethercote-4/+2
2019-11-01Rollup merge of #66018 - pnkfelix:issue-64872-revert-64324, r=alexcrichtonTyler Mandry-15/+4
Revert PR 64324: dylibs export generics again (for now) As discussed on PR #65781, this is a targeted attempt to undo the main semantic change from PR #64324, by putting `dylib` back in the set of crate types that export generic symbols. The main reason to do this is that PR #64324 had unanticipated side-effects that caused bugs like #64872, and in the opinion of @alexcrichton and myself, the impact of #64872 is worse than #64319. In other words, it is better for us, in the short term, to reopen #64319 as currently unfixed for now than to introduce new bugs like #64872. Fix #64872 Reopen #64319
2019-11-01targeted revert of PR rust-lang/rust#64324 (just undo change to dylib ↵Felix S. Klock II-15/+4
generics export). Includes the anticipated fallout to run-make-fulldeps test suite from this change. (We need to reopen issue 64319 as part of landing this.)
2019-10-31rustc_codegen_ssa: introduce MIR VarDebugInfo, but only for codegen.Eduard-Mihai Burtescu-138/+186
2019-10-31rustc_codegen_ssa: hide address ops from the declare_local interface.Eduard-Mihai Burtescu-24/+23
2019-10-31rustc_codegen_ssa: move debuginfo scopes into FunctionDebugContext.Eduard-Mihai Burtescu-80/+38
2019-10-31rustc_codegen_ssa: change set_var_name back to taking a &str.Eduard-Mihai Burtescu-32/+8
2019-10-31rustc_codegen_ssa: move all set_var_name calls to mir::debuginfo.Eduard-Mihai Burtescu-87/+118
2019-10-31rustc_codegen_ssa: move local variable debuginfo to mir::debuginfo.Eduard-Mihai Burtescu-241/+227
2019-10-31rustc_codegen_ssa: move debuginfo-related things to a new mir::debuginfo module.Eduard-Mihai Burtescu-144/+152
2019-10-30caller_location: point to macro invocation sites, like file!/line!.Eduard-Mihai Burtescu-1/+2
2019-10-29Rollup merge of #65832 - tlively:emscripten-exception-handling, r=alexcrichtonTyler Mandry-2/+3
Re-enable Emscripten's exception handling support Passes LLVM codegen and Emscripten link-time flags for exception handling if and only if the panic strategy is `unwind`. Sets the default panic strategy for Emscripten targets to `unwind`. Re-enables tests that depend on unwinding support for Emscripten, including `should_panic` tests. r? @alexcrichton
2019-10-29Auto merge of #65435 - michaelwoerister:fix-issue-64153, r=alexcrichtonbors-19/+26
Fix #64153 This PR changes how the compiler detects if an object file from an upstream crate is a Rust object file or not. Instead of checking if the name starts with the crate name and ends with `.o` (which is not always the case, as described in #64153), it now just checks if the filename ends with `.rcgu.o`. This fixes #64153. However, ideally we'd clean up the code around filename generation some more. Then this check could be made more robust. r? @alexcrichton
2019-10-29Rollup merge of #65294 - varkor:lint-inline-prototype, r=matthewjasperMazdak Farrokhzad-1/+1
Lint ignored `#[inline]` on function prototypes Fixes https://github.com/rust-lang/rust/issues/51280. - Adds a `unused_attribute` lint for `#[inline]` on function prototypes. - As a consequence, foreign items, impl items and trait items now have their attributes checked, which could cause some code to no longer compile (it was previously erroneously ignored).
2019-10-28self-profiling: Record something more useful for crate metadata generation ↵Michael Woerister-2/+0
event. Before this commit, we had an event that would only track the compression step for proc-macros and Rust dylibs. After the commit we measure the time for acutally generating the crate metadata bytes.
2019-10-28Rollup merge of #65792 - Centril:split-syntax-2, r=petrochenkovMazdak Farrokhzad-4/+3
rustc, rustc_passes: reduce deps on rustc_expand Part of #65324. r? @petrochenkov
2019-10-27Always use consteval to codegen caller_location.Adam Perry-12/+20
2019-10-27Panicking infra uses &core::panic::Location.Adam Perry-48/+8
This allows us to remove `static_panic_msg` from the SSA<->LLVM boundary, along with its fat pointer representation for &str. Also changes the signature of PanicInfo::internal_contructor to avoid copying. Closes #65856.
2019-10-27Implement core::intrinsics::caller_location.Adam Perry-0/+20
Returns a `&core::panic::Location` corresponding to where it was called, also making `Location` a lang item.
2019-10-27rustc, rustc_passes: don't depend on syntax_expand.Mazdak Farrokhzad-4/+3
This is done by moving some data definitions to syntax::expand.
2019-10-26Rollup merge of #65772 - mark-i-m:final-readmes, r=nikomatsakisMazdak Farrokhzad-120/+2
Remove the last remaining READMEs cc https://github.com/rust-lang/rustc-guide/pull/481 closes #48478 r? @nikomatsakis
2019-10-25Update bitflagsvarkor-1/+1
2019-10-25Re-enable Emscripten's exception handling supportThomas Lively-2/+3
Passes LLVM codegen and Emscripten link-time flags for exception handling if and only if the panic strategy is `unwind`. Sets the default panic strategy for Emscripten targets to `unwind`. Re-enables tests that depend on unwinding support for Emscripten, including `should_panic` tests.
2019-10-25Don't cast directly from `&[T; N]` to `*const T`Matthew Jasper-0/+1
Instead coerce to `*const [T; N]` and then cast.
2019-10-25Rollup merge of #65315 - spastorino:intern-place-projection, r=oli-obkMazdak Farrokhzad-65/+40
Intern place projection This should sit on top of https://github.com/rust-lang/rust/pull/65197. After that one merged, I'm gonna rebase on top of it. The important commits are the last three and there's a bunch of code repetition that I'm going to remove but for that I need to refactor some things that probably need to be added before this PR. Anyway this work helps as is because we can run perf tests :). r? @oli-obk /cc @nikomatsakis
2019-10-24remove the last remaining READMEsMark Mansi-120/+2
2019-10-23Rollup merge of #65657 - nnethercote:rm-InternedString-properly, r=eddybMazdak Farrokhzad-5/+5
Remove `InternedString` This PR removes `InternedString` by converting all occurrences to `Symbol`. There are a handful of places that need to use the symbol chars instead of the symbol index, e.g. for stable sorting; local conversions `LocalInternedString` is used in those places. r? @eddyb