Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Codegen the arguments to Kani intrinsics inside the functions that ha…
…ndle the intrinsics (#2924) This is a refactor change: currently, the functions that codegen Kani intrinsics (asserts, assumes, etc.) take the arguments to the intrinsics as Boogie expressions (`boogie_ast::boogie_program::Expr`). In other words, the MIR arguments (`rustc_middle::mir::syntax::Operand`) are converted to Boogie expressions before passing them to the functions. This PR changes the functions to take the MIR arguments directly, and perform the codegen into Boogie expressions inside the functions. This allows those functions to query any information in the MIR `Operand`, that is not available after codegen to Boogie expressions. Note: it may make sense to do the same change for the Goto backend to avoid having to pattern match on the expressions (e.g. https://github.com/model-checking/kani/blob/2aca488ba9d64d2aaeae3b7774acf367bea42be9/kani-compiler/src/codegen_cprover_gotoc/overrides/hooks.rs#L74), and instead get the information needed from the MIR operand directly. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.
- Loading branch information