Skip to content

Commit 401a46c

Browse files
authored
Merge pull request #2869 from diffblue/run-interface
Clean up run.h interface
2 parents 1dfc476 + 57eac33 commit 401a46c

File tree

7 files changed

+14
-18
lines changed

7 files changed

+14
-18
lines changed

src/goto-cc/as_mode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ int as_modet::run_as()
267267
std::cout << '\n';
268268
#endif
269269

270-
return run(new_argv[0], new_argv, cmdline.stdin_file);
270+
return run(new_argv[0], new_argv, cmdline.stdin_file, "", "");
271271
}
272272

273273
int as_modet::as_hybrid_binary()

src/goto-cc/gcc_mode.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ int gcc_modet::preprocess(
835835
debug() << " " << new_argv[i];
836836
debug() << eom;
837837

838-
return run(new_argv[0], new_argv, cmdline.stdin_file, stdout_file);
838+
return run(new_argv[0], new_argv, cmdline.stdin_file, stdout_file, "");
839839
}
840840

841841
int gcc_modet::run_gcc(const compilet &compiler)
@@ -878,7 +878,7 @@ int gcc_modet::run_gcc(const compilet &compiler)
878878
debug() << " " << new_argv[i];
879879
debug() << eom;
880880

881-
return run(new_argv[0], new_argv, cmdline.stdin_file);
881+
return run(new_argv[0], new_argv, cmdline.stdin_file, "", "");
882882
}
883883

884884
int gcc_modet::gcc_hybrid_binary(compilet &compiler)

src/goto-cc/hybrid_binary.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ int hybrid_binary(
5252
"--remove-section", "goto-cc",
5353
"--add-section", "goto-cc=" + goto_binary_file, output_file};
5454

55-
result = run(objcopy_argv[0], objcopy_argv, "", "");
55+
result = run(objcopy_argv[0], objcopy_argv);
5656
}
5757

5858
// delete the goto binary
@@ -79,7 +79,7 @@ int hybrid_binary(
7979
"lipo", output_file, "-create", "-arch", "hppa7100LC", goto_binary_file,
8080
"-output", output_file };
8181

82-
result = run(lipo_argv[0], lipo_argv, "", "");
82+
result = run(lipo_argv[0], lipo_argv);
8383
}
8484

8585
// delete the goto binary

src/goto-cc/ld_mode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ int ld_modet::run_ld()
163163
debug() << " " << new_argv[i];
164164
debug() << eom;
165165

166-
return run(new_argv[0], new_argv, cmdline.stdin_file, "");
166+
return run(new_argv[0], new_argv, cmdline.stdin_file, "", "");
167167
}
168168

169169
int ld_modet::ld_hybrid_binary(compilet &compiler)

src/goto-cc/linker_script_merge.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ int linker_script_merget::get_linker_script_data(
696696
debug() << " " << argv[i];
697697
debug() << eom;
698698

699-
int rc=run(argv[0], argv, linker_def_infile(), def_out_file);
699+
int rc = run(argv[0], argv, linker_def_infile(), def_out_file, "");
700700
if(rc!=0)
701701
warning() << "Problem parsing linker script" << eom;
702702

src/util/run.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,9 @@ Date: August 2012
3232
#include <util/unicode.h>
3333
#include <util/signal_catcher.h>
3434

35-
int run_shell(const std::string &command)
35+
int run(const std::string &what, const std::vector<std::string> &argv)
3636
{
37-
std::string shell="/bin/sh";
38-
std::vector<std::string> argv;
39-
argv.push_back(shell);
40-
argv.push_back(command);
41-
return run(shell, argv, "", "", "");
37+
return run(what, argv, "", "", "");
4238
}
4339

4440
#ifndef _WIN32

src/util/run.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ Date: August 2012
1515
#include <string>
1616
#include <vector>
1717

18+
int run(const std::string &what, const std::vector<std::string> &argv);
19+
1820
int run(
1921
const std::string &what,
2022
const std::vector<std::string> &argv,
21-
const std::string &std_input = "",
22-
const std::string &std_output = "",
23-
const std::string &std_error = "");
24-
25-
int run_shell(const std::string &command);
23+
const std::string &std_input,
24+
const std::string &std_output,
25+
const std::string &std_error);
2626

2727
#endif // CPROVER_UTIL_RUN_H

0 commit comments

Comments
 (0)