about summary refs log tree commit diff
path: root/compiler/rustc_symbol_mangling/src
AgeCommit message (Collapse)AuthorLines
2021-07-06Revert "Revert "Merge CrateDisambiguator into StableCrateId""bjorn3-8/+9
This reverts commit 8176ab8bc18fdd7d3c2cf7f720c51166364c33a3.
2021-07-01Skip layout query when computing integer type size during manglingTomasz Miąsko-5/+5
2021-06-07Revert "Merge CrateDisambiguator into StableCrateId"bjorn3-9/+8
This reverts commit d0ec85d3fb6d322496cb8f4bc1c21e19f23284ad.
2021-06-02Restrict access to crate_name.Camille GILLOT-2/+2
Also remove original_crate_name, which had the exact same implementation
2021-06-01Revert "Reduce the amount of untracked state in TyCtxt"Camille Gillot-2/+2
2021-05-30Restrict access to crate_name.Camille GILLOT-2/+2
Also remove original_crate_name, which had the exact same implementation
2021-05-30Merge CrateDisambiguator into StableCrateIdbjorn3-9/+8
2021-05-24remove cfg(bootstrap)Pietro Albini-1/+0
2021-05-18Rollup merge of #83767 - camelid:mangle-v0-fix, r=nikomatsakisJack Huey-6/+37
Fix v0 symbol mangling bug Fixes #83611. r? ``@jackh726``
2021-05-15Change to just use first binders and add testJack Huey-26/+47
2021-05-13Fix v0 symbol mangling bugCamelid-16/+26
2021-05-12Use () for proc_macro_decls_static.Camille GILLOT-1/+1
2021-05-12Use () for plugin_registrar_fn.Camille GILLOT-1/+1
2021-04-05Rollup merge of #80525 - devsnek:wasm64, r=nagisaDylan DPC-1/+1
wasm64 support There is still some upstream llvm work needed before this can land.
2021-04-04wasm64Gus Caplan-1/+1
2021-03-31Add var to BoundRegion. Add query to get bound vars for applicable items.Jack Huey-1/+1
2021-03-31Add tcx lifetime to BinderJack Huey-3/+3
2021-03-19stabilize or_patternsmark-1/+1
2021-03-09rustc_target: add "unwind" payloads to `Abi`katelyn a. martin-1/+1
### Overview This commit begins the implementation work for RFC 2945. For more information, see the rendered RFC [1] and tracking issue [2]. A boolean `unwind` payload is added to the `C`, `System`, `Stdcall`, and `Thiscall` variants, marking whether unwinding across FFI boundaries is acceptable. The cases where each of these variants' `unwind` member is true correspond with the `C-unwind`, `system-unwind`, `stdcall-unwind`, and `thiscall-unwind` ABI strings introduced in RFC 2945 [3]. ### Feature Gate and Unstable Book This commit adds a `c_unwind` feature gate for the new ABI strings. Tests for this feature gate are included in `src/test/ui/c-unwind/`, which ensure that this feature gate works correctly for each of the new ABIs. A new language features entry in the unstable book is added as well. ### Further Work To Be Done This commit does not proceed to implement the new unwinding ABIs, and is intentionally scoped specifically to *defining* the ABIs and their feature flag. ### One Note on Test Churn This will lead to some test churn, in re-blessing hash tests, as the deleted comment in `src/librustc_target/spec/abi.rs` mentioned, because we can no longer guarantee the ordering of the `Abi` variants. While this is a downside, this decision was made bearing in mind that RFC 2945 states the following, in the "Other `unwind` Strings" section [3]: > More unwind variants of existing ABI strings may be introduced, > with the same semantics, without an additional RFC. Adding a new variant for each of these cases, rather than specifying a payload for a given ABI, would quickly become untenable, and make working with the `Abi` enum prone to mistakes. This approach encodes the unwinding information *into* a given ABI, to account for the future possibility of other `-unwind` ABI strings. ### Ignore Directives `ignore-*` directives are used in two of our `*-unwind` ABI test cases. Specifically, the `stdcall-unwind` and `thiscall-unwind` test cases ignore architectures that do not support `stdcall` and `thiscall`, respectively. These directives are cribbed from `src/test/ui/c-variadic/variadic-ffi-1.rs` for `stdcall`, and `src/test/ui/extern/extern-thiscall.rs` for `thiscall`. This would otherwise fail on some targets, see: https://github.com/rust-lang-ci/rust/commit/fcf697f90206e9c87b39d494f94ab35d976bfc60 ### Footnotes [1]: https://github.com/rust-lang/rfcs/blob/master/text/2945-c-unwind-abi.md [2]: https://github.com/rust-lang/rust/issues/74990 [3]: https://github.com/rust-lang/rfcs/blob/master/text/2945-c-unwind-abi.md#other-unwind-abi-strings
2021-02-15Use less HirId when referring to items.Camille GILLOT-6/+6
2021-02-15Only store a LocalDefId in hir::ForeignItem.Camille GILLOT-1/+1
2021-02-15Only store a LocalDefId in hir::ImplItem.Camille GILLOT-1/+1
2021-02-15Only store a LocalDefId in hir::TraitItem.Camille GILLOT-1/+1
2021-02-15Only store a LocalDefId in hir::Item.Camille GILLOT-1/+1
Items are guaranteed to be HIR owner.
2021-01-30Rollup merge of #80959 - jhpratt:unsigned_abs-stabilization, r=m-ou-seYuki Okushi-1/+1
Stabilize `unsigned_abs` Resolves #74913. This PR stabilizes the `i*::unsigned_abs()` method, which returns the absolute value of an integer _as its unsigned equivalent_. This has the advantage that it does not overflow on `i*::MIN`. I have gone ahead and used this in a couple locations throughout the repository.
2021-01-18Use ty::{IntTy,UintTy,FloatTy} in rustcLeSeulArtichaut-2/+1
2021-01-13Use unsigned_abs throughout repositoryJacob Pratt-1/+1
2021-01-10Rollup merge of #79968 - bjorn3:better_drop_glue_debuginfo, r=matthewjasperYuki Okushi-1/+9
Improve core::ptr::drop_in_place debuginfo * Use span of the dropped type as function span when possible. * Rename symbol from `core::ptr::drop_in_place::$hash` to `{{drop}}::<$TYPE>::$hash`. Fixes #77465 (I haven't yet updated the tests)
2020-12-18Make BoundRegion have a kind of BoungRegionKindJack Huey-1/+1
2020-12-17Auto merge of #79945 - jackh726:existential_trait_ref, r=nikomatsakisbors-21/+22
Move binder for dyn to each list item This essentially changes `ty::Binder<&'tcx List<ExistentialTraitRef>>` to `&'tcx List<ty::Binder<ExistentialTraitRef>>`. This is a first step in moving the `dyn Trait` representation closer to Chalk, which we've talked about in `@rust-lang/wg-traits.` r? `@nikomatsakis`
2020-12-17Simplify based on eddyb's commentbjorn3-21/+9
2020-12-14Convenience funcs for `some_option.unwrap_or(...)`Rich Kadel-5/+1
This ensures consistent handling of default values for options that are None if not specified on the command line.
2020-12-14Improve warnings on incompatible options involving -Zinstrument-coverageRich Kadel-1/+5
Adds checks for: * `no_core` attribute * explicitly-enabled `legacy` symbol mangling * mir_opt_level > 1 (which enables inlining) I removed code from the `Inline` MIR pass that forcibly disabled inlining if `-Zinstrument-coverage` was set. The default `mir_opt_level` does not enable inlining anyway. But if the level is explicitly set and is greater than 1, I issue a warning. The new warnings show up in tests, which is much better for diagnosing potential option conflicts in these cases.
2020-12-12Use better symbol names for the drop gluebjorn3-0/+20
2020-12-11Move binder for dyn to each list itemJack Huey-21/+22
2020-11-26Store ForeignItem in a side table.Camille GILLOT-0/+4
2020-11-16compiler: fold by valueBastian Kauschke-2/+2
2020-11-04`u128` truncation and sign extension are not just interpreter relatedoli-2/+1
2020-11-04s/Scalar::Raw/Scalar::Intoli-1/+1
2020-10-30Fix even more clippy warningsJoshua Nelson-20/+11
2020-10-29Make anonymous binders start at 0Jack Huey-13/+3
2020-10-21Do not print type for placeholder valuesvarkor-1/+2
2020-10-21Support signed integers and `char` in v0 manglingvarkor-6/+20
2020-10-16Rollup merge of #75675 - davidtwco:symbol-mangling-impl-params, r=eddybDylan DPC-27/+48
mangling: mangle impl params w/ v0 scheme This PR modifies v0 symbol mangling to include all generic parameters from impl blocks (not just those used in the self type) - an alternative fix to #75326. ``` original: _RNCNvXCs4fqI2P2rA04_19impl_param_manglingINtB4_3FooppENtNtNtNtCsfnEnqCNU58Z_4core4iter6traits8iterator8Iterator4next0B4_ // |------------ B4_ ----------------| // _R (N C (N v (X (C ((s 4fqI2p2rA04_) 19impl_param_mangling)) (I (N t B4_ 3Foo) pp E) (N t (N t (N t (N t (C ((s fnEnqCNU58Z_) 4core)) 4iter) 6traits) 8iterator) 8Iterator)) 4next) 0) B4_ modified: _RNvXINICs4fqI2P2rA04_11issue_753260pppEINtB5_3FooppENtNtNtNtCsfnEnqCNU58Z_4core4iter6traits8iterator8Iterator4nextB5_ // _R (N v (X (I (N I (C ((s 4fqI2P2rA04_) 11issue_75326)) 0) ppp E) (I (N t B5_ 3Foo) pp E) (N t (N t (N t (N t (C ((s fnEnqCNU58Z_) 4core)) 4iter) 6traits) 8iterator) 8Iterator)) 4next) B5_ // | ^ | // | | | // | new impl namespace | ``` ~~Submitted as a draft as after some discussion w/ @eddyb, I'm going to do some investigation into (yet more alternative) changes to polymorphization that might remove the necessity for this.~~ r? @eddyb
2020-10-15mangling: encode all impl parametersDavid Wood-23/+42
This commit modifies v0 symbol mangling to include all generic parameters from impl blocks (not just those used in the self type). Signed-off-by: David Wood <david@davidtw.co>
2020-10-15mangling: non-monomorphic `#[rustc_symbol_name]`David Wood-4/+6
This commit adjust `#[rustc_symbol_name]` so that it can be applied to non-monomorphic functions without producing an ICE. Signed-off-by: David Wood <david@davidtw.co>
2020-10-15Replace target.target with target and target.ptr_width with target.pointer_widthest31-1/+1
Preparation for a subsequent change that replaces rustc_target::config::Config with its wrapped Target. On its own, this commit breaks the build. I don't like making build-breaking commits, but in this instance I believe that it makes review easier, as the "real" changes of this PR can be seen much more easily. Result of running: find compiler/ -type f -exec sed -i -e 's/target\.target\([)\.,; ]\)/target\1/g' {} \; find compiler/ -type f -exec sed -i -e 's/target\.target$/target/g' {} \; find compiler/ -type f -exec sed -i -e 's/target.ptr_width/target.pointer_width/g' {} \; ./x.py fmt
2020-10-13Replace absolute paths with relative onesest31-1/+1
Modern compilers allow reaching external crates like std or core via relative paths in modules outside of lib.rs and main.rs.
2020-10-07Rollup merge of #77605 - da-x:fix-rustc-def-path, r=petrochenkovDylan DPC-1/+2
Fix rustc_def_path to show the full path and not the trimmed one Follow-up fix for #73996.
2020-10-06Fix rustc_def_path to show the full path and not the trimmed oneDan Aloni-1/+2