Age | Commit message (Collapse) | Author | Files | Lines |
|
1549: Dump macro declarations properly r=CohenArthur a=CohenArthur
Dump `MacroRulesDef` properly
Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
|
|
1596: Add more implementations for TARGET_RUST_OS_INFO r=philberty a=ibuclaw
Pretty much all follow the same template as how darwin was added in the first commit, so mostly uninteresting.
The only slight deviation is with `*-*-linux*`, where rather than putting it in a common `glibc-rust.cc` file, I've instead opted to force each platform have their own source file. So Linux gets a `linux-rust.cc` file, and anyone who wants to add Hurd, kFreeBSD, or kOpenSolaris later can do so by adding a case to this switch with the appropriately named file (i.e: `gnu-rust.cc` for Hurd).
The same can also be said for MinGW targets - `winnt-rust.cc` is explicitly _not_ set for Cygwin, and I'd prefer that whoever does add Cygwin support will create a separate file for it - otherwise you've either got to modify the target headers to add whatever defines you need in order to abstract the two away, or start adding some defines to `tm_rust.h` to expose hints about the target known at configure time.
Linux is also the only implementation that has an `#ifndef` condition, as not all Linux targets include `linux-android.{h,opt}`.
Checked dumps of target_options on a plethora of target configurations, though this list is by no means exhaustive.
---
<details>
<summary>i686-dragonflybsd</summary>
```
target_pointer_width: "32"
target_env: ""
target_vendor: "unknown"
target_endian: "little"
target_os: "dragonfly"
target_family: "unix"
target_arch: "x86"
```
</details>
<details>
<summary>x86_64-dragonflybsd</summary>
```
target_pointer_width: "64"
target_env: ""
target_vendor: "unknown"
target_endian: "little"
target_os: "dragonfly"
target_family: "unix"
target_feature: "fxsr"
target_feature: "sse"
target_feature: "sse2"
target_feature: "mmx"
target_arch: "x86_64"
```
</details>
<details>
<summary>aarch64-freebsd12, ia64-freebsd6, riscv64-freebsd12</summary>
```
target_pointer_width: "64"
target_env: ""
target_vendor: "unknown"
target_endian: "little"
target_os: "freebsd"
target_family: "unix"
```
</details>
<details>
<summary>arm-freebsd12</summary>
```
target_pointer_width: "32"
target_env: ""
target_vendor: "unknown"
target_endian: "little"
target_os: "freebsd"
target_family: "unix"
```
</details>
<details>
<summary>i486-freebsd4, i686-freebsd6</summary>
```
target_pointer_width: "32"
target_env: ""
target_vendor: "unknown"
target_endian: "little"
target_os: "freebsd"
target_family: "unix"
target_arch: "x86"
```
</details>
<details>
<summary>powerpc-freebsd6</summary>
```
target_pointer_width: "32"
target_env: ""
target_vendor: "unknown"
target_endian: "big"
target_os: "freebsd"
target_family: "unix"
```
</details>
<details>
<summary>sparc64-freebsd6</summary>
```
target_pointer_width: "64"
target_env: ""
target_vendor: "unknown"
target_endian: "big"
target_os: "freebsd"
target_family: "unix"
```
</details>
<details>
<summary>x86_64-freebsd6</summary>
```
target_pointer_width: "64"
target_env: ""
target_vendor: "unknown"
target_endian: "little"
target_os: "freebsd"
target_family: "unix"
target_feature: "fxsr"
target_feature: "sse"
target_feature: "sse2"
target_feature: "mmx"
target_arch: "x86_64"
```
</details>
<details>
<summary>aarch64-fuchsia</summary>
```
target_pointer_width: "64"
target_env: ""
target_vendor: "unknown"
target_endian: "little"
target_os: "fushsia"
target_family: "unix"
```
</details>
<details>
<summary>x86_64-fuchsia</summary>
```
target_pointer_width: "64"
target_env: ""
target_vendor: "unknown"
target_endian: "little"
target_os: "fushsia"
target_family: "unix"
target_feature: "fxsr"
target_feature: "sse"
target_feature: "sse2"
target_feature: "mmx"
target_arch: "x86_64"
```
</details>
<details>
<summary>i686-kfreebsd-gnu</summary>
```
target_endian: "little"
target_pointer_width: "32"
target_arch: "x86"
```
</details>
<details>
<summary>arm-linux-androideabi</summary>
```
target_pointer_width: "32"
target_env: ""
target_endian: "little"
target_os: "android"
target_vendor: "unknown"
target_family: "unix"
```
</details>
<details>
<summary>aarch64-linux-gnu, alpha-linux-gnu, ia64-linux, riscv64-unknown-linux-gnu</summary>
```
target_pointer_width: "64"
target_env: "gnu"
target_endian: "little"
target_os: "linux"
target_vendor: "unknown"
target_family: "unix"
```
</details>
<details>
<summary>am33_2.0-linux-gnu, csky-linux-gnu, mips64el-st-linux-gnu, nios2-linux-gnu, powerpcle-linux, riscv32-unknown-linux-gnu, rx-linux, shle-linux, vax-linux-gnu</summary>
```
target_pointer_width: "32"
target_env: "gnu"
target_endian: "little"
target_os: "linux"
target_vendor: "unknown"
target_family: "unix"
```
</details>
<details>
<summary>arc-linux-uclibc, bfin-linux-uclibc</summary>
```
target_pointer_width: "32"
target_env: "uclibc"
target_endian: "little"
target_os: "linux"
target_vendor: "unknown"
target_family: "unix"
```
</details>
<details>
<summary>arceb-linux-uclibc, or1k-linux-uclibc</summary>
```
target_pointer_width: "32"
target_env: "uclibc"
target_endian: "big"
target_os: "linux"
target_vendor: "unknown"
target_family: "unix"
```
</details>
<details>
<summary>frv-linux, h8300-linux, hppa-linux-gnu, m68k-linux, microblaze-linux, mips64octeon-linux, mipsisa32r2-linux-gnu, mipsisa64r2-linux, mips-linux, mips-mti-linux, powerpc64-linux_altivec, powerpc-linux, s390-linux-gnu, sparc-leon3-linux-gnu, sparc-linux-gnu, xtensa-linux</summary>
```
target_pointer_width: "32"
target_env: "gnu"
target_endian: "big"
target_os: "linux"
target_vendor: "unknown"
target_family: "unix"
```
</details>
<details>
<summary>hppa64-linux-gnu, s390x-linux-gnu, sparc64-linux</summary>
```
target_pointer_width: "64"
target_env: "gnu"
target_endian: "big"
target_os: "linux"
target_vendor: "unknown"
target_family: "unix"
```
</details>
<details>
<summary>i686-pc-linux-gnu, i686-pc-linux</summary>
```
target_pointer_width: "32"
target_env: "gnu"
target_endian: "little"
target_os: "linux"
target_vendor: "unknown"
target_family: "unix"
target_arch: "x86"
```
</details>
<details>
<summary>or1k-linux-musl</summary>
```
target_pointer_width: "32"
target_env: "musl"
target_endian: "big"
target_os: "linux"
target_vendor: "unknown"
target_family: "unix"
```
</details>
<details>
<summary>i686-mingw32crt</summary>
```
target_pointer_width: "32"
target_env: "gnu"
target_vendor: "pc"
target_endian: "little"
target_os: "windows"
target_family: "windows"
target_arch: "x86"
```
</details>
<details>
<summary>x86_64-mingw32, x86_64-w64-mingw32</summary>
```
target_pointer_width: "64"
target_env: "gnu"
target_vendor: "pc"
target_endian: "little"
target_os: "windows"
target_family: "windows"
target_feature: "fxsr"
target_feature: "sse"
target_feature: "sse2"
target_feature: "mmx"
target_arch: "x86_64"
```
</details>
<details>
<summary>aarch64-netbsd, alpha-netbsd</summary>
```
target_pointer_width: "64"
target_env: ""
target_vendor: "unknown"
target_endian: "little"
target_os: "netbsd"
target_family: "unix"
```
</details>
<details>
<summary>arm-netbsdelf, vax-netbsdelf</summary>
```
target_pointer_width: "32"
target_env: ""
target_vendor: "unknown"
target_endian: "little"
target_os: "netbsd"
target_family: "unix"
```
</details>
<details>
<summary>hppa-netbsd, m68k-netbsdelf, mips-netbsd, powerpc-netbsd, sh-netbsdelf, sparc-netbsdelf</summary>
```
target_pointer_width: "32"
target_env: ""
target_vendor: "unknown"
target_endian: "big"
target_os: "netbsd"
target_family: "unix"
```
</details>
<details>
<summary>i686-netbsdelf9</summary>
```
target_pointer_width: "32"
target_env: ""
target_vendor: "unknown"
target_endian: "little"
target_os: "netbsd"
target_family: "unix"
target_arch: "x86"
```
</details>
<details>
<summary>sparc64-netbsd</summary>
```
target_pointer_width: "64"
target_env: ""
target_vendor: "unknown"
target_endian: "big"
target_os: "netbsd"
target_family: "unix"
```
</details>
<details>
<summary>x86_64-netbsd</summary>
```
target_pointer_width: "64"
target_env: ""
target_vendor: "unknown"
target_endian: "little"
target_os: "netbsd"
target_family: "unix"
target_feature: "fxsr"
target_feature: "sse"
target_feature: "sse2"
target_feature: "mmx"
target_arch: "x86_64"
```
</details>
<details>
<summary>alpha-openbsd</summary>
```
target_pointer_width: "64"
target_env: ""
target_vendor: "unknown"
target_endian: "little"
target_os: "openbsd"
target_family: "unix"
```
</details>
<details>
<summary>bfin-openbsd</summary>
```
target_pointer_width: "32"
target_env: ""
target_vendor: "unknown"
target_endian: "little"
target_os: "openbsd"
target_family: "unix"
```
</details>
<details>
<summary>i686-openbsd</summary>
```
target_pointer_width: "32"
target_env: ""
target_vendor: "unknown"
target_endian: "little"
target_os: "openbsd"
target_family: "unix"
target_arch: "x86"
```
</details>
<details>
<summary>sparc64-openbsd</summary>
```
target_pointer_width: "64"
target_env: ""
target_vendor: "unknown"
target_endian: "big"
target_os: "openbsd"
target_family: "unix"
```
</details>
<details>
<summary>x86_64-openbsd</summary>
```
target_pointer_width: "64"
target_env: ""
target_vendor: "unknown"
target_endian: "little"
target_os: "openbsd"
target_family: "unix"
target_feature: "fxsr"
target_feature: "sse"
target_feature: "sse2"
target_feature: "mmx"
target_arch: "x86_64"
```
</details>
<details>
<summary>aarch64-wrs-vxworks</summary>
```
target_pointer_width: "64"
target_env: "gnu"
target_vendor: "wrs"
target_endian: "little"
target_os: "vxworks"
target_family: "unix"
```
</details>
<details>
<summary>arm-wrs-vxworks7</summary>
```
target_pointer_width: "32"
target_env: "gnu"
target_vendor: "wrs"
target_endian: "little"
target_os: "vxworks"
target_family: "unix"
```
</details>
<details>
<summary>i686-wrs-vxworks, i686-wrs-vxworksae</summary>
```
target_pointer_width: "32"
target_env: "gnu"
target_vendor: "wrs"
target_endian: "little"
target_os: "vxworks"
target_family: "unix"
target_arch: "x86"
```
</details>
<details>
<summary>mips-wrs-vxworks, powerpc-wrs-vxworksae, powerpc-wrs-vxworks, powerpc-wrs-vxworksmils, sh-wrs-vxworks, sparc-wrs-vxworks</summary>
```
target_pointer_width: "32"
target_env: "gnu"
target_vendor: "wrs"
target_endian: "big"
target_os: "vxworks"
target_family: "unix"
```
</details>
<details>
<summary>arm-uclinux_eabi, bfin-uclinux, c6x-uclinux</summary>
```
target_endian: "little"
target_pointer_width: "32"
```
</details>
<details>
<summary>lm32-uclinux, m68k-uclinux, moxie-uclinux, xtensa-uclinux</summary>
```
target_endian: "big"
target_pointer_width: "32"
```
</details>
Co-authored-by: Iain Buclaw <ibuclaw@gdcproject.org>
|
|
1602: Add check for recursive trait cycles r=philberty a=philberty
This adds a new RAII style TraitQueryGuard so that we can manage the query lifetime when resolving a trait. This adds in a DefId into a set when we begin to resolve and then finally removes it when completed. This allows us to add in a check at the start if this DefId is already within the set which means this is a trait cycle.
Fixes #1589
Co-authored-by: Philip Herron <philip.herron@embecosm.com>
|
|
This adds a new RAII style TraitQueryGuard so that we can manage the query
lifetime when resolving a trait. This adds in a DefId into a set when we
begin to resolve and then finally removes it when completed. This allows
us to add in a check at the start if this DefId is already within the set
which means this is a trait cycle.
Fixes #1589
|
|
1597: ast: Module: unloaded module and inner attributes r=CohenArthur a=jdupak
Adds support for unloaded modules and dumps also inner attributes.
Resolves issue found in #1548.
Co-authored-by: Jakub Dupak <dev@jakubdupak.com>
|
|
Co-authored-by: jdupak <dev@jakubdupak.com>
|
|
1594: Refactor TraitResolver to not require a visitor r=philberty a=philberty
We used a visitor to dispatch the HIR::Item so that we could cast it directly to an HIR::Trait and then check for nullptr if it failed. This patch changes this to simply use our new enum item_type_kind to switch so we can directly static_cast.
1595: Support outer attribute handling on trait items just like normal items r=philberty a=philberty
This patch adds a proxy class ItemWrapper to be a proxy allowing us to use the same code paths for attribute handling as we have with normal items. We need this so we can grab the fn trait associated type lang item's. Which are being missed currently.
Addresses #195
Co-authored-by: Philip Herron <philip.herron@embecosm.com>
|
|
Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
|
|
1548: Dump module items r=CohenArthur a=CohenArthur
1593: ast: dump TypeAlias r=CohenArthur a=jdupak
Implements ast dump for TypeAlias
Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
Co-authored-by: Jakub Dupak <dev@jakubdupak.com>
|
|
Co-authored-by: jdupak <dev@jakubdupak.com>
|
|
1590: AST: more dump improvements r=dafaust a=dafaust
This PR adds new AST dump visitors for several nodes, and cleans up some minor formatting issues in blocks without tail expressions and if expressions.
Co-authored-by: David Faust <david.faust@oracle.com>
|
|
|
|
|
|
This patch adds a proxy class ItemWrapper to be a proxy allowing us to use
the same code paths for attribute handling as we have with normal items. We
need this so we can grab the fn trait associated type lang item's. Which
are being missed currently.
Addresses #195
|
|
Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
|
|
1580: Add early name resolver r=CohenArthur a=CohenArthur
This addresses our issue with name resolution (#1576) not acting on macros early enough but does not fix it yet.
This name resolver performs the same macro name resolution as what was previously done by the AttrVisitor visitor and macro expander.
It also resolves macro expressions in builtin-macros properly, as well as expanded AST nodes when necessary.
Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
|
|
We used a visitor to dispatch the HIR::Item so that we could cast it directly to an HIR::Trait and then check for nullptr if it failed. This
patch changes this to simply use our new enum item_type_kind to switch so
we can directly static_cast.
|
|
1587: Method resolution must support multiple candidates r=philberty a=philberty
This patch fixes bad method resolution in our operator_overload_9 case.
When we have a &mut reference to something and we deref we must resolve to
the mutable reference impl block. The interface we are using to resolve
methods is the can_eq interface which allows for permissive mutability
which means allowing for mutable reference being unified with an immutable
one. This meant we actual match against both the immutable and mutable
version leading to multiple candidate error.
Fixes #1588
Co-authored-by: Philip Herron <philip.herron@embecosm.com>
|
|
1583: Support type resolution on super traits on dyn objects r=philberty a=philberty
When checking if specified bounds satisfy other bounds we must lookup the super traits. To finish the support for super traits we need to redo the computation of method addresses to support super traits.
Addresses #914
Co-authored-by: Philip Herron <philip.herron@embecosm.com>
|
|
|
|
Adds dump for:
- BorrowExpr
- DereferenceExpr
- ErrorPropagationExpr
- NegationExpr
- TypeCastExpr
- GroupedExpr
|
|
|
|
|
|
|
|
|
|
1584: Add missing lang item mappings r=philberty a=philberty
Adds the missing fn_once lang item and the missing rust-call abi option.
Co-authored-by: Philip Herron <philip.herron@embecosm.com>
|
|
This patch fixes bad method resolution in our operator_overload_9 case.
When we have a &mut reference to something and we deref we must resolve to
the mutable reference impl block. The interface we are using to resolve
methods is the can_eq interface which allows for permissive mutability
which means allowing for mutable reference being unified with an immutable
one. This meant we actual match against both the immutable and mutable
version leading to multiple candidate error.
The fix here adds a method resolution flag to the can_eq interface so that
we enforce mutability equality. The other hack is that we do not allow
can_eq of ParamTypes to generic Slices. I think there is some subtle thing
going on for that case. The Rustc method resolver actually filters the
impl blocks for reference types based looking up the relevant lang items
we need to do this as well but is a much larger refactor to our method
resolver which should be done seperately.
Fixes #1588
|
|
gcc/ChangeLog:
* config.gcc (*linux*): Set rust target_objs, and
target_has_targetrustm,
* config/t-linux (linux-rust.o): New rule.
* config/linux-rust.cc: New file.
|
|
gcc/ChangeLog:
* config.gcc (i[34567]86-*-mingw* | x86_64-*-mingw*): Set
rust_target_objs and target_has_targetrustm.
* config/t-winnt (winnt-rust.o): New rule.
* config/winnt-rust.cc: New file.
|
|
gcc/ChangeLog:
* config.gcc (*-*-fuchsia): Set tmake_rule, rust_target_objs,
and target_has_targetrustm.
* config/fuchsia-rust.cc: New file.
* config/t-fuchsia: New file.
|
|
gcc/ChangeLog:
* config.gcc (*-*-vxworks*): Set rust_target_objs and
target_has_targetrustm.
* config/t-vxworks (vxworks-rust.o): New rule.
* config/vxworks-rust.cc: New file.
|
|
gcc/ChangeLog:
* config.gcc (*-*-dragonfly*): Set rust_target_objs and
target_has_targetrustm.
* config/t-dragonfly (dragonfly-rust.o): New rule.
* config/dragonfly-rust.cc: New file.
|
|
gcc/ChangeLog:
* config.gcc (*-*-solaris2*): Set rust_target_objs and
target_has_targetrustm.
* config/t-sol2 (sol2-rust.o): New rule.
* config/sol2-rust.cc: New file.
|
|
gcc/ChangeLog:
* config.gcc (*-*-openbsd*): Set rust_target_objs and
target_has_targetrustm.
* config/t-openbsd (openbsd-rust.o): New rule.
* config/openbsd-rust.cc: New file.
|
|
gcc/ChangeLog:
* config.gcc (*-*-netbsd*): Set rust_target_objs and
target_has_targetrustm.
* config/t-netbsd (netbsd-rust.o): New rule.
* config/netbsd-rust.cc: New file.
|
|
gcc/ChangeLog:
* config.gcc (*-*-freebsd*): Set rust_target_objs and
target_has_targetrustm.
* config/t-freebsd (freebsd-rust.o): New rule.
* config/freebsd-rust.cc: New file.
|
|
1570: Apply #1560 master r=CohenArthur a=CohenArthur
Same as #1560, but in a single more descriptive commit. I'll hold on doing the other fixes until you're okay with the process `@philberty`
Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
|
|
|
|
|
|
When checking if specified bounds satisfy other bounds we must lookup the
super traits. To finish the support for super traits we need to redo the
computation of method addresses to support super traits.
Addresses #914
|
|
This name resolver performs the same macro name resolution as what was
previously done by the AttrVisitor visitor and macro expander.
It also resolves macro expressions in builtin-macros properly, as well
as expanded AST nodes when necessary.
|
|
|
|
|
|
|
|
1574: fix ICE on missing closing paren r=dkm a=dkm
Fix crash (segfault) on a missing closing parenthesis when parsing the expressions in a block. The returned `expr` was missing a check before being used.
Add corresponding test.
Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
Co-authored-by: Marc Poulhiès <dkm@kataplop.net>
|
|
Fix crash (segfault) on a missing closing parenthesis when parsing the
expressions in a block. The returned `expr` was missing a check before being
used.
Add corresponding test.
Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
|
|
1572: AST: dump structs, unions and enums r=dafaust a=dafaust
Co-authored-by: David Faust <david.faust@oracle.com>
|
|
1543: Reintroduce targetrustm hooks without the maze of macro definitions in target headers r=CohenArthur a=ibuclaw
- Adds skeleton support and documentation for targetrustm hooks.
- Re-adds previously reverted `TARGET_RUST_CPU_INFO` target hook.
- Re-adds the previously reverted `TARGET_RUST_OS_INFO` target hook.
- Implements `TARGET_RUST_CPU_INFO` hook for x86 (only a subset of the original i386-rust.cc was re-added)
- Implements `TARGET_RUST_OS_INFO` hook for darwin (covers both x86 and powerpc).
There's quite a bit to unpick from what was removed, but I hope this shows how firstly `rust-target.h` and `tm_rust.h` should be kept as empty as possible for the `default-rust.cc` source file that pulls in these headers; secondly all rust macros and declarations be put in rust-specific headers, then pulled into tm_rust.h as-needed. From every other `${target}-rust.cc` file, you can include as much as you like in order to pry out the information you need to get at.
I've verified this does work as expected with the `-frust-dump-target_options` switch, e.g with `-mavx2`
```
target_endian: "little"
target_pointer_width: "64"
target_feature: "fxsr"
target_feature: "popcnt"
target_feature: "avx2"
target_feature: "ssse3"
target_feature: "sse4.1"
target_feature: "sse3"
target_feature: "avx"
target_feature: "sse"
target_feature: "xsave"
target_feature: "sse4.2"
target_feature: "sse2"
target_feature: "mmx"
target_arch: "x86_64"
```
I've also built a few darwin cross compilers with the following results on i686-darwin
```
target_pointer_width: "32"
target_env: ""
target_vendor: "apple"
target_endian: "little"
target_os: "macos"
target_family: "unix"
target_feature: "sse3"
target_feature: "sse"
target_feature: "sse2"
target_feature: "mmx"
target_arch: "x86"
```
and on powerpc64-darwin
```
target_pointer_width: "64"
target_env: ""
target_vendor: "apple"
target_endian: "big"
target_os: "macos"
target_family: "unix"
```
Co-authored-by: Iain Buclaw <ibuclaw@gdcproject.org>
|
|
1565: Implement data prefetch intrinsics r=CohenArthur a=CohenArthur
Addresses #658
Needs #1564 so only review the last commit
This PR implements the two intrinsics related to data prefetching. I have to say, since these are hints for the backend, I am unsure if the current implementation is right. I believe it should be.
Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
|
|
|