Add function ABI and type layout to StableMIR

This change introduces a new module to StableMIR named `abi` with
information from `rustc_target::abi` and `rustc_abi`, that allow users
to retrieve more low level information required to perform
bit-precise analysis.

The layout of a type can be retrieved via `Ty::layout`, and the instance
ABI can be retrieved via `Instance::fn_abi()`.

To properly handle errors while retrieve layout information, we had
to implement a few layout related traits.
This commit is contained in:
Celina G. Val
2023-12-18 19:52:25 +00:00
parent 2a7634047a
commit 1a83c5b55b
14 changed files with 760 additions and 25 deletions

View File

@@ -33,6 +33,7 @@ use crate::mir::Body;
use crate::mir::Mutability;
use crate::ty::{ImplDef, ImplTrait, IndexedVal, Span, TraitDecl, TraitDef, Ty};
pub mod abi;
#[macro_use]
pub mod crate_def;
pub mod compiler_interface;