about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorLeón Orell Valerian Liehr <me@fmease.dev>2024-02-21 16:33:00 +0100
committerGitHub <noreply@github.com>2024-02-21 16:33:00 +0100
commitbd7ba278e5f9bec119aef80e5fd09b2f93700c42 (patch)
tree9a2ee4e170ea5ee7fe632fbb43c1fb3aad4a7e32 /compiler/rustc_codegen_llvm/src
parentae01e99831b4db3c43d69345709c6c2fae041086 (diff)
parent9eabdc2a4cc896065004fb8566509daa11d6562a (diff)
downloadrust-bd7ba278e5f9bec119aef80e5fd09b2f93700c42.tar.gz
rust-bd7ba278e5f9bec119aef80e5fd09b2f93700c42.zip
Rollup merge of #121396 - RalfJung:mir-const-value-inspect, r=oli-obk
make it possible for outside crates to inspect a mir::ConstValue with the interpreter

For MiniRust we need to convert MIR constant values into MiniRust constant values. However, it's not currently possible to get nice high-level access to the inerts of a `ConstValue`: we can access the raw contents (the allocation / `ScalarInt`), but if it is e.g. of enum type and we want to determine which variant is encoded, we are stuck. There's only `try_destructure_mir_constant_for_user_output` which is meant for diagnostics, so it doesn't fit.

The interpreter has all the APIs to traverse such a value, so we just need a way to get such a ConstValue into an interpreter instance. This adds the public functions necessary to make that happen.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions