Skip to content

Commit bf9db47

Browse files
committed
Delete dead code
1 parent 2b88967 commit bf9db47

File tree

2 files changed

+1
-52
lines changed

2 files changed

+1
-52
lines changed

kani-driver/src/call_cbmc.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use std::collections::btree_map::Entry;
1010
use std::ffi::OsString;
1111
use std::fmt::Write;
1212
use std::path::Path;
13-
use std::process::Command;
1413
use std::sync::OnceLock;
1514
use std::time::{Duration, Instant};
1615
use tokio::process::Command as TokioCommand;
@@ -168,23 +167,6 @@ impl KaniSession {
168167
Ok(verification_results)
169168
}
170169

171-
/// used by call_cbmc_viewer, invokes different variants of CBMC.
172-
// TODO: this could use some cleanup and refactoring.
173-
pub fn call_cbmc(&self, args: Vec<OsString>, output: &Path) -> Result<()> {
174-
// TODO get cbmc path from self
175-
let mut cmd = Command::new("cbmc");
176-
cmd.args(args);
177-
178-
let result = self.run_redirect(cmd, output)?;
179-
180-
if !result.success() {
181-
bail!("cbmc exited with status {}", result);
182-
}
183-
// TODO: We 'bail' above, but then ignore it in 'call_cbmc_viewer' ...
184-
185-
Ok(())
186-
}
187-
188170
/// "Internal," but also used by call_cbmc_viewer
189171
pub fn cbmc_flags(
190172
&self,

kani-driver/src/session.rs

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use anyhow::{Context, Result, bail};
99
use std::io::IsTerminal;
1010
use std::io::Write;
1111
use std::path::{Path, PathBuf};
12-
use std::process::{Child, Command, ExitStatus, Stdio};
12+
use std::process::{Child, Command, Stdio};
1313
use std::sync::Mutex;
1414
use std::time::Instant;
1515
use strum_macros::Display;
@@ -134,11 +134,6 @@ impl KaniSession {
134134
run_suppress(&self.args.common_args, cmd)
135135
}
136136

137-
/// Call [run_redirect] with the verbosity configured by the user.
138-
pub fn run_redirect(&self, cmd: Command, stdout: &Path) -> Result<ExitStatus> {
139-
run_redirect(&self.args.common_args, cmd, stdout)
140-
}
141-
142137
/// Call [run_piped] with the verbosity configured by the user.
143138
pub fn run_piped(&self, cmd: Command) -> Result<Child> {
144139
run_piped(&self.args.common_args, cmd)
@@ -164,7 +159,6 @@ impl KaniSession {
164159
// Default Quiet Verbose Default Quiet Verbose
165160
// run_terminal Y N Y Y N Y (inherits terminal)
166161
// run_suppress N N Y Y N Y (buffered text only)
167-
// run_redirect (not applicable, always to the file) (only option where error is acceptable)
168162

169163
/// Run a job, leave it outputting to terminal (unless --quiet), and fail if there's a problem.
170164
pub fn run_terminal(verbosity: &impl Verbosity, mut cmd: Command) -> Result<()> {
@@ -254,33 +248,6 @@ pub fn run_suppress(verbosity: &impl Verbosity, mut cmd: Command) -> Result<()>
254248
Ok(())
255249
}
256250

257-
/// Run a job, redirect its output to a file, and allow the caller to decide what to do with failure.
258-
pub fn run_redirect(
259-
verbosity: &impl Verbosity,
260-
mut cmd: Command,
261-
stdout: &Path,
262-
) -> Result<ExitStatus> {
263-
if verbosity.verbose() {
264-
println!(
265-
"[Kani] Running: `{} > {}`",
266-
render_command(&cmd).to_string_lossy(),
267-
stdout.display()
268-
);
269-
}
270-
let output_file = std::fs::File::create(stdout)?;
271-
cmd.stdout(output_file);
272-
273-
let program = cmd.get_program().to_string_lossy().to_string();
274-
with_timer(
275-
verbosity,
276-
|| {
277-
cmd.status()
278-
.context(format!("Failed to invoke {}", cmd.get_program().to_string_lossy()))
279-
},
280-
&program,
281-
)
282-
}
283-
284251
/// Run a job and pipe its output to this process.
285252
/// Returns an error if the process could not be spawned.
286253
///

0 commit comments

Comments
 (0)