about summary refs log tree commit diff
path: root/src/librustc_target
AgeCommit message (Collapse)AuthorLines
2020-03-29Rollup merge of #69702 - anyska:tylayout-rename, r=oli-obkDylan DPC-134/+133
Rename TyLayout to TyAndLayout.
2020-03-27Rename TyLayout to TyAndLayout.Ana-Maria Mihalache-134/+133
2020-03-27Remove `no_integrated_as` mode.Nicholas Nethercote-9/+0
Specifically, remove both `-Z no_integrated_as` and `TargetOptions::no_integrated_as`. The latter was only used for the `msp430_none_elf` platform, for which it's no longer required.
2020-03-26Rollup merge of #70384 - nnethercote:refactor-object-file-handling, ↵Dylan DPC-6/+0
r=alexcrichton Refactor object file handling Some preliminary clean-ups that grease the path to #66961. r? @alexcrichton
2020-03-25Rollup merge of #69700 - anyska:layout-details-rename, r=oli-obkDylan DPC-12/+13
Rename LayoutDetails to just Layout.
2020-03-25Rename LayoutDetails to just Layout.Ana-Maria Mihalache-12/+13
2020-03-25add usize methods for Size gettersRalf Jung-0/+10
2020-03-25make Size::from* methods generic in the integer type they acceptRalf Jung-5/+6
2020-03-25miri: avoid a bunch of casts by offering usized-based field indexingRalf Jung-1/+2
2020-03-25Remove `TargetOptions::embed_bitcode`.Nicholas Nethercote-6/+0
It's unused by any existing targets, and soon we'll be embedding full bitcode by default anyway.
2020-03-23Split long derive lists into two derive attributes.Ana-Maria Mihalache-13/+2
2020-03-21remove unused unit values (clippy::unused_unit)Matthias Krüger-20/+6
2020-03-21don't convert results to options just for matching (clippy::if_let_some_result)Matthias Krüger-2/+2
2020-03-21Rollup merge of #70189 - RalfJung:is_signed, r=eddybMazdak Farrokhzad-1/+1
Abi::is_signed: assert that we are a Scalar A bit more sanity checking, suggested by @eddyb. This makes this method actually "safer" than `TyS::is_signed`, so I made sure Miri consistently uses the `Abi` version. Though I am not sure if this would have caught the mistake where the layout of a zero-sized enum was asked for its sign. r? @eddyb
2020-03-20Abi::is_signed: assert that we are a ScalarRalf Jung-1/+1
2020-03-20Rollup merge of #69768 - oli-obk:union_field_ice, r=eddyb,RalfJungYuki Okushi-1/+4
Compute the correct layout for variants of uninhabited enums r? @eddyb cc @RalfJung fixes #69191 cc #69763
2020-03-17Add requisite feature gates for const assertDylan MacKenzie-0/+3
2020-03-13Auto merge of #67502 - Mark-Simulacrum:opt-catch, r=Mark-Simulacrumbors-11/+41
Optimize catch_unwind to match C++ try/catch This refactors the implementation of catching unwinds to allow LLVM to inline the "try" closure directly into the happy path, avoiding indirection. This means that the catch_unwind implementation is (after this PR) zero-cost unless a panic is thrown. https://rust.godbolt.org/z/cZcUSB is an example of the current codegen in a simple case. Notably, the codegen is *exactly the same* if `-Cpanic=abort` is passed, which is clearly not great. This PR, on the other hand, generates the following assembly: ```asm # -Cpanic=unwind: push rbx mov ebx,0x2a call QWORD PTR [rip+0x1c53c] # <happy> mov eax,ebx pop rbx ret mov rdi,rax call QWORD PTR [rip+0x1c537] # cleanup function call call QWORD PTR [rip+0x1c539] # <unfortunate> mov ebx,0xd mov eax,ebx pop rbx ret # -Cpanic=abort: push rax call QWORD PTR [rip+0x20a1] # <happy> mov eax,0x2a pop rcx ret ``` Fixes #64224, and resolves #64222.
2020-03-12Rollup merge of #69747 - spastorino:rename-rustc-guide, r=pietroalbiniMazdak Farrokhzad-2/+2
Rename rustc guide This is in preparation for https://github.com/rust-lang/rustc-guide/issues/470 Needs to be merged after we actually rename the guide. Have used this to rename: `git grep -l 'rustc_guide' | xargs sed -i 's/rustc_guide/rustc_dev_guide/g'` `git grep -l 'rustc-guide' | xargs sed -i 's/rustc-guide/rustc-dev-guide/g'` `git grep -l 'rustc guide' | xargs sed -i 's/rustc guide/rustc dev guide/g'`
2020-03-12Auto merge of #68191 - simlay:add-tvSO-target, r=nagisabors-21/+90
Added tvOS as targets This is a first attempt of adding support tvOS as described in #48862. It's got a lot of overlap with [src/librustc_target/spec/apple_ios_base.rs](https://github.com/rust-lang/rust/blob/31dd4f4acbcbdb02b0745d2136399ed664a28050/src/librustc_target/spec/apple_ios_base.rs). I thought about refactoring `apple_ios_base.rs` to include this as well but that would require each of the ios and tvos targets to be of the something like the form `let base = opts(AppleOS::TV, Arch::Arm64)?;` I also did the same thing for watchOS because from what I can tell, all three targets (iOS, tvOS, and watchOS) have the same logic but have different parameters being sent to `xcrun`. Thoughts? As far as the `data_layout` and other parameters to `Target`, I did as much research as I could but it really seems that processor in the [iPhone 11 is the same as the apple TV](https://en.wikipedia.org/wiki/Apple-designed_processors) so I didn't change any of those parameters. I did get this to build and tested that it's actually running the the below logic (because the parameter to `xcrun` is `appletvos` not `tvos`). I didn't manage to get it to actually compile a file with `fn main(){}` because I don't have the stdlib for `aarch64-apple-tvos` compiled it seems. Is there documentation for this? Similar to the ending of https://github.com/rust-lang/rust/pull/63467, I'm not sure what to do next.
2020-03-11Rustfmt and adjust capitalizationOliver Scherer-3/+2
2020-03-11Compute the correct layout for variants of uninhabited enums and readd a ↵Oliver Scherer-1/+5
long lost assertion This reverts part of commit 9712fa405944cb8d5416556ac4b1f26365a10658.
2020-03-11Rollup merge of #66059 - RalfJung:panic-on-non-zero, r=eddybMazdak Farrokhzad-0/+88
mem::zeroed/uninit: panic on types that do not permit zero-initialization r? @eddyb @oli-obk Cc https://github.com/rust-lang/rust/issues/62825 Also see [this summary comment](https://github.com/rust-lang/rust/pull/66059#issuecomment-586734747)
2020-03-10rust-lang.github.io/rustc-dev-guide -> rustc-dev-guide.rust-lang.orgSantiago Pastorino-1/+1
2020-03-10Rename rustc guide to rustc dev guideSantiago Pastorino-2/+2
2020-03-10Rename rustc-guide to rustc-dev-guideSantiago Pastorino-1/+1
2020-03-08Rollup merge of #69646 - RalfJung:layout-visitor, r=eddybMazdak Farrokhzad-1/+1
Miri visitor: detect primitive types based on type, not layout (also, more tests) I also converted the union-based transmutes to use `mem::transmute` for increased readability. r? @eddyb @oli-obk
2020-03-06'fieldless enums' is not what I meant -- it's empty/uninhabited enums, reallyRalf Jung-1/+1
2020-03-06fix various typosMatthias Krüger-8/+8
2020-03-05Link to libgcc dynamically on windows-gnu when using dylib cratesAmanieu d'Antras-2/+41
2020-03-05Remove eh_unwind_resume lang itemAmanieu d'Antras-9/+0
2020-03-02Auto merge of #69257 - RalfJung:layout-visitor, r=eddybbors-1/+19
Adjust Miri value visitor, and doc-comment layout components I realized that I still didn't have quite the right intuition for how our `LayoutDetails` work, so I had to adjust the Miri value visitor to the things I understood better now. I also added some doc-comments to `LayoutDetails` as a hopefully canonical place to note such things. The main visitor change is that we *first* look at all the fields (according to `FieldPlacement`), and *then* check the variants and handle `Multiple` appropriately. I did not quite realize how orthogonal "fields" and "variants" are. I also moved the check for the scalar ABI to *after* checking all the fields; this leads to better (more type-driven) error messages. And it looks like we can finally remove that magic hack for `ty::Generator`. :D r? @oli-obk for the Miri/visitor changes and @eddyb for the layout docs The Miri PR is at: https://github.com/rust-lang/miri/pull/1178
2020-03-01Rollup merge of #69549 - mati865:mingw, r=kennytmYuki Okushi-0/+2
Improve MinGW detection when cross compiling Official mingw-w64 builds, MSYS2 and LLVM MinGW provide both `gcc.exe` and `$ARCH-w64-mingw32-gcc.exe` so they should not regress but I included CI changes to verify it though `@bors try` (I don't have permission). This change will come handy when cross compiling from Linux or Cygwin since they use `gcc` as native compiler and `$ARCH-w64-mingw32-gcc.exe` for MinGW. This means users will no longer have to override the linker.
2020-02-29move pattern to fn argumentRalf Jung-2/+1
2020-02-29we cannot short-circuit just becuase the Abi seems harmlessRalf Jung-50/+13
also add tests for ScalarPair enums
2020-02-29fmtRalf Jung-19/+15
2020-02-29make it even more conservative, and note some FIXMEsRalf Jung-5/+13
2020-02-29use valid_range_exclusive for correct overflow handlingRalf Jung-4/+7
2020-02-29reference tracking issueRalf Jung-3/+4
2020-02-29mem::zeroed/uninit: panic on types that do not permit zero-initializationRalf Jung-0/+118
2020-02-28Improve MinGW detection when cross compilingMateusz Mikuła-0/+2
2020-02-27use char instead of &str for single char patternsMatthias Krüger-3/+3
2020-02-26adjust LayoutDetails commentsRalf Jung-7/+7
2020-02-20fmtSebastian Imlay-19/+17
2020-02-18doc comments for layout componentsRalf Jung-1/+19
2020-02-18Fix typoJonas Schievink-1/+1
2020-02-17Don't eliminate frame pointers on thumb targetsJonas Schievink-0/+3
2020-02-14Merged apple_tvos_base and apple_ios_base into apple_sdk_base.Sebastian Imlay-150/+51
2020-02-14Merge branch 'master' of github.com:rust-lang/rust into add-tvSO-targetSebastian Imlay-138/+663
2020-02-12Properly use the darwin archive format on Apple targetsAnthony Ramine-1/+1
See https://github.com/servo/servo/issues/25550.