Skip to content

Commit 7592365

Browse files
authored
Create kani_middle module to host backend agnostic code (rust-lang#1833)
For now I just moved the reachability code to this new module. As a follow up PR, I am planning to move the unsized coercion related code into a separate module so it can be used to refactor and fix codegen casting logic (related issues rust-lang#1531, rust-lang#566, and rust-lang#1528) .
1 parent 6ef19f2 commit 7592365

File tree

5 files changed

+7
-2
lines changed

5 files changed

+7
-2
lines changed

kani-compiler/src/codegen_cprover_gotoc/compiler_interface.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
//! This file contains the code necessary to interface with the compiler backend
55
6-
use crate::codegen_cprover_gotoc::reachability::{collect_reachable_items, filter_crate_items};
76
use crate::codegen_cprover_gotoc::GotocCtx;
7+
use crate::kani_middle::reachability::{collect_reachable_items, filter_crate_items};
88
use bitflags::_core::any::Any;
99
use cbmc::goto_program::{symtab_transformer, Location};
1010
use cbmc::{InternedString, MachineModel};

kani-compiler/src/codegen_cprover_gotoc/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ mod codegen;
55
mod compiler_interface;
66
mod context;
77
mod overrides;
8-
mod reachability;
98
mod utils;
109

1110
pub use compiler_interface::GotocCodegenBackend;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Copyright Kani Contributors
2+
// SPDX-License-Identifier: Apache-2.0 OR MIT
3+
//! This module contains code that are backend agnostic. For example, MIR analysis
4+
//! and transformations.
5+
pub mod reachability;

kani-compiler/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ extern crate rustc_target;
2828

2929
#[cfg(feature = "cprover")]
3030
mod codegen_cprover_gotoc;
31+
mod kani_middle;
3132
mod parser;
3233
mod session;
3334
mod unsound_experiments;

0 commit comments

Comments
 (0)