-
Notifications
You must be signed in to change notification settings - Fork 104
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
1 parent
3c4289c
commit dc78b84
Showing
2 changed files
with
14 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters