summary refs log tree commit diff
path: root/compiler/rustc_symbol_mangling/src
AgeCommit message (Collapse)AuthorLines
2022-11-26Rollup merge of #104786 - WaffleLapkin:amp-mut-help, r=compiler-errorsGuillaume Gomez-1/+1
Use the power of adding helper function to simplify code w/ `Mutability` r? `@compiler-errors`
2022-11-25Add empty ConstKind::Abstractkadmin-0/+1
Initial pass at expr/abstract const/s Address comments Switch to using a list instead of &[ty::Const], rm `AbstractConst` Remove try_unify_abstract_consts Update comments Add edits Recurse more More edits Prevent equating associated consts Move failing test to ui Changes this test from incremental to ui, and mark it as failing and a known bug. Does not cause the compiler to ICE, so should be ok.
2022-11-23Add `Mutability::{is_mut,is_not}`Maybe Waffle-1/+1
2022-11-21Unreserve braced enum variants in value namespaceVadim Petrochenkov-4/+4
2022-11-19drive-by: PolyExistentialPredicateMichael Goulet-7/+7
2022-11-07Add an optional Span to BrAnon and use it to print better error for HRTB ↵Jack Huey-2/+2
error from generator interior
2022-11-04Refactor tcx mk_const parameters.Mateusz-2/+1
2022-10-29Rename some `OwnerId` fields.Nicholas Nethercote-4/+4
spastorino noticed some silly expressions like `item_id.def_id.def_id`. This commit renames several `def_id: OwnerId` fields as `owner_id`, so those expressions become `item_id.owner_id.def_id`. `item_id.owner_id.local_def_id` would be even clearer, but the use of `def_id` for values of type `LocalDefId` is *very* widespread, so I left that alone.
2022-10-23Migrate all diagnosticsNilstrieb-1/+1
2022-10-14more dupe word typosRageking8-1/+1
2022-10-04It's not about types or consts, but the lack of regionsOli Scherer-1/+1
2022-09-24separate definitions and `HIR` ownersTakayuki Maeda-4/+4
fix a ui test use `into` fix clippy ui test fix a run-make-fulldeps test implement `IntoQueryParam<DefId>` for `OwnerId` use `OwnerId` for more queries change the type of `ParentOwnerIterator::Item` to `(OwnerId, OwnerNode)`
2022-09-21UPDATE - rename DiagnosticHandler trait to IntoDiagnosticJhonny Bill Mena-2/+2
2022-09-19remove the `Subst` trait, always use `EarlyBinder`lcnr-1/+1
2022-09-16Rollup merge of #101782 - ↵Michael Howell-32/+34
JhonnyBillM:refactor-symbol-mangling-diags-migration, r=davidtwco Update `symbol_mangling` diagnostics migration Addresses comments raised in #100831. r? `@eddyb` `@davidtwco`
2022-09-13Address code review commentsEric Holk-4/+11
2022-09-13UPDATE - merge and avoid translations for symbol mangling test outputJhonny Bill Mena-32/+34
2022-09-12Plumb dyn trait representation through ty::DynamicEric Holk-2/+2
2022-09-08Remove ReEmptyJack Huey-2/+1
2022-09-05Pack `Term` in the same way as `GenericArg`.Nicholas Nethercote-11/+7
This shrinks the `PredicateS` type, which is instanted frequently.
2022-09-01Always import all tracing macros for the entire crate instead of piecemeal ↵Oli Scherer-4/+3
by module
2022-08-30UPDATE - to support diag introduced in PR #100765Jhonny Bill Mena-4/+4
2022-08-30ADD - diagnostics lints to symbol_mangling moduleJhonny Bill Mena-0/+2
2022-08-30ADD - migrate InvalidDefPath to new diagnostics infraJhonny Bill Mena-3/+13
2022-08-30UPDATE - accept String instead of unused 'strJhonny Bill Mena-9/+9
2022-08-30ADD - migrate InvalidTraitItem and AltInvalidTraitItem errorsJhonny Bill Mena-3/+25
Thought of doing this by having a struct and an enum with Default and Alt cases, but not sure if we wanted to have the text in code instead of having “demangling()” and “demangling-alt()” in the ftl file. Don’t like the current way of having structs representing the same-ish and using long names to distinguish their expectations, instead of putting this in an enum and handling the different cases inside the type. I am fine with whichever option the team prefers; also understand having them as separate structs keeps it simple.
2022-08-30ADD - InvalidSymbolName to migrate symbol-name({}) error to new diagnostics ↵Jhonny Bill Mena-1/+18
infraestructure ADD - dependencies needed to port a module to new Diagnostics infra (rustc_macros, rustc_errors, errors file, and fluent file)
2022-08-26Change `FnAbi::fixed_count` to a `u32`.Nicholas Nethercote-1/+1
2022-07-24Auto merge of #95548 - rcvalle:rust-cfi-2, r=nagisabors-43/+949
Add fine-grained LLVM CFI support to the Rust compiler This PR improves the LLVM Control Flow Integrity (CFI) support in the Rust compiler by providing forward-edge control flow protection for Rust-compiled code only by aggregating function pointers in groups identified by their return and parameter types. Forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space) will be provided in later work as part of this project by identifying C char and integer type uses at the time types are encoded (see Type metadata in the design document in the tracking issue https://github.com/rust-lang/rust/issues/89653). LLVM CFI can be enabled with -Zsanitizer=cfi and requires LTO (i.e., -Clto). Thank you again, `@eddyb,` `@nagisa,` `@pcc,` and `@tmiasko` for all the help!
2022-07-23Add fine-grained LLVM CFI support to the Rust compilerRamon de C Valle-43/+949
This commit improves the LLVM Control Flow Integrity (CFI) support in the Rust compiler by providing forward-edge control flow protection for Rust-compiled code only by aggregating function pointers in groups identified by their return and parameter types. Forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space) will be provided in later work as part of this project by identifying C char and integer type uses at the time types are encoded (see Type metadata in the design document in the tracking issue #89653). LLVM CFI can be enabled with -Zsanitizer=cfi and requires LTO (i.e., -Clto).
2022-07-20consistently use VTable over Vtable (matching stable stdlib API RawWakerVTable)Ralf Jung-3/+3
2022-07-06Allow to create definitions inside the query system.Camille GILLOT-36/+37
2022-07-06Update TypeVisitor pathsAlan Egerton-2/+2
2022-07-05Relax constrained generics to TypeVisitableAlan Egerton-2/+2
2022-06-14Auto merge of #96285 - flip1995:pk-vfe, r=nagisabors-0/+25
Introduce `-Zvirtual-function-elimination` codegen flag Fixes #68262 This PR adds a codegen flag `-Zvirtual-function-elimination` to enable the VFE optimization in LLVM. To make this work, additonal information has to be added to vtables ([`!vcall_visibility` metadata](https://llvm.org/docs/TypeMetadata.html#vcall-visibility-metadata) and a `typeid` of the trait). Furthermore, instead of just `load`ing functions, the [`llvm.type.checked.load` intrinsic](https://llvm.org/docs/LangRef.html#llvm-type-checked-load-intrinsic) has to be used to map functions to vtables. For technical details of the changes, see the commit messages. I also tested this flag on https://github.com/tock/tock on different boards to verify that this fixes the issue https://github.com/tock/tock/issues/2594. This flag is able to improve the size of the resulting binary by about 8k-9k bytes by removing the unused debug print functions. [Rendered documentation update](https://github.com/flip1995/rust/blob/pk-vfe/src/doc/rustc/src/codegen-options/index.md#virtual-function-elimination)
2022-06-14rebaseb-naber-1/+1
2022-06-14address reviewb-naber-3/+2
2022-06-14implement valtrees as the type-system representation for constant valuesb-naber-43/+52
2022-06-14Add typeid_for_trait_ref functionflip1995-0/+25
This function computes a Itanium-like typeid for a trait_ref. This is required for the VFE optimization in LLVM. It is used to map `llvm.type.checked.load` invocations, that is loading the function from a vtable, to the vtables this function could be from. It is important to note that `typeid`s are not unique. So multiple vtables of the same trait can share `typeid`s.
2022-06-14Rename the `ConstS::val` field as `kind`.Nicholas Nethercote-5/+5
And likewise for the `Const::val` method. Because its type is called `ConstKind`. Also `val` is a confusing name because `ConstKind` is an enum with seven variants, one of which is called `Value`. Also, this gives consistency with `TyS` and `PredicateS` which have `kind` fields. The commit also renames a few `Const` variables from `val` to `c`, to avoid confusion with the `ConstKind::Value` variant.
2022-06-03Fully stabilize NLLJack Huey-1/+0
2022-05-14Auto merge of #96883 - jackh726:early-binder-2, r=oli-obkbors-2/+4
Add EarlyBinder Chalk has no concept of `Param` (https://github.com/rust-lang/chalk/blob/e0ade19d139bc784384acc6736cd960c91dd55a1/chalk-ir/src/lib.rs#L579) or `ReEarlyBound` (https://github.com/rust-lang/chalk/blob/e0ade19d139bc784384acc6736cd960c91dd55a1/chalk-ir/src/lib.rs#L1308). Everything is just "bound" - the equivalent of rustc's late-bound. It's not completely clear yet whether to move everything to the same time of binder in rustc or add `Param` and `ReEarlyBound` in Chalk. Either way, tracking when we have or haven't already substituted out these in rustc can be helpful. As a first step, I'm just adding a `EarlyBinder` newtype that is required to call `subst`. I also add a couple "transparent" `bound_*` wrappers around a couple query that are often immediately substituted. r? `@nikomatsakis`
2022-05-13Rollup merge of #96989 - cjgillot:defpath-use, r=davidtwcoMatthias Krüger-1/+2
Be more precise than DefPathData::Misc. This variant was used for two unrelated things. Let's make this cleaner.
2022-05-12Replace DefPathData::Misc by two appropriately-named variants.Camille GILLOT-1/+2
2022-05-10Introduce EarlyBinderJack Huey-2/+4
2022-05-10only_local: always check for misuselcnr-19/+18
2022-05-09reviewlcnr-1/+1
2022-05-09only compute `codegen_fn_attrs` where neededlcnr-14/+25
2022-04-17Auto merge of #95655 - kckeiks:create-hir-crate-items-query, r=cjgillotbors-21/+18
Refactor HIR item-like traversal (part 1) Issue #95004 - Create hir_crate_items query which traverses tcx.hir_crate(()).owners to return a hir::ModuleItems - use tcx.hir_crate_items in tcx.hir().items() to return an iterator of hir::ItemId - use tcx.hir_crate_items to introduce a tcx.hir().par_items(impl Fn(hir::ItemId)) to traverse all items in parallel; Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com> cc `@cjgillot`
2022-04-13Auto merge of #95656 - cjgillot:no-id-hashing-mode, r=Aaron1011bors-22/+19
Remove NodeIdHashingMode. r? `@ghost`