commit 628290d06b85f087ae14e4d60abc644deb271303
parent dfd7b73cf76f7219f1d05d58ad52b19f2fc40af8
Author: Kyle Milz <kyle@0x30.net>
Date: Mon, 11 Jul 2016 19:10:29 -0600
src: remove is_citrun hacks
Diffstat:
1 file changed, 2 insertions(+), 17 deletions(-)
diff --git a/src/inst_main.cc b/src/inst_main.cc
@@ -177,10 +177,8 @@ patch_link_command(std::vector<char *> &args)
int
main(int argc, char *argv[])
{
- bool is_citrun_inst = ends_with(argv[0], "citrun-inst");
- if (! is_citrun_inst)
- setprogname("citrun-inst");
-
+ // We probably didn't call citrun-inst directly.
+ setprogname("citrun-inst");
clean_path();
std::vector<char *> args(argv, argv + argc);
@@ -195,9 +193,6 @@ main(int argc, char *argv[])
for (auto &arg : args) {
if (strcmp(arg, "-E") == 0) {
- if (is_citrun_inst)
- errx(1, "citrun-inst -E not supported");
-
// Preprocessing argument found, exec native command
if (execvp(argv[0], argv))
err(1, "execvp");
@@ -228,23 +223,13 @@ main(int argc, char *argv[])
}
if (instrument(argc, argv, source_files)) {
- // Instrumentation failed.
restore_original_src(temp_file_map);
- if (is_citrun_inst)
- errx(1, "instrumentation failed");
-
warnx("Instrumentation failed, compiling unmodified code.");
if (execvp(argv[0], argv))
err(1, "execvp");
}
- if (is_citrun_inst) {
- // Ran directly and instrumentation (if any) didn't fail.
- restore_original_src(temp_file_map);
- return 0;
- }
-
bool linking = false;
if (!object_arg && !compile_arg && source_files.size() > 0)
// Assume single line a.out compilation