about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-12-06 17:21:58 +0100
committerGitHub <noreply@github.com>2023-12-06 17:21:58 +0100
commit67d8999d179714cef6ade504501263b464f54e29 (patch)
tree43915169f6a75592c0acf155e3510cb920826a70 /compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
parentdf6bc93f0e75923f2a770b17e8cc0a7cb91f3116 (diff)
parent326fea0fb86e148adc8168ac70a5ceddef3ad9a3 (diff)
downloadrust-67d8999d179714cef6ade504501263b464f54e29.tar.gz
rust-67d8999d179714cef6ade504501263b464f54e29.zip
Rollup merge of #118516 - celinval:smir-variants, r=ouz-a
Add ADT variant infomation to StableMIR and finish implementing TyKind::internal()

Introduce a `VariantDef` type and a mechanism to retrieve the definition from an `AdtDef`.

The `VariantDef` representation itself is just a combination of `AdtDef` and `VariantIdx`, which allow us to retrieve further information of a variant. I don't think we need to cache extra information for now, and we can translate on an on demand manner. I am  leaving the fields public today due to https://github.com/rust-lang/project-stable-mir/issues/56, but they shouldn't. For this PR, I've only added a method to retrieve the variant name, and its fields. I also added an implementation of `RustcInternal` that allow users to retrieve more information using Rust internal APIs.

I have also finished the implementation of `RustcInternal` for `TyKind` which fixes https://github.com/rust-lang/project-stable-mir/issues/46.

## Motivation

Both of these changes are needed in order to properly interpret things like projections. For example,
- The variant definition is used to find out which variant we are downcasting to.
- Being able to create `Ty` from `TyKind` helps for example processing each stage of a projection, like the code in `place.ty()`.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions