[libFuzzer] Encapsulate commands in a class.
Summary:
To be more portable (especially w.r.t. platforms without system()),
commands should be managed programmatically rather than via string
manipulation on the command line. This change introduces
Fuzzer::Command, with methods to manage arguments and flags, set output
options, and execute the command.
Patch By: aarongreen
Reviewers: kcc, morehouse
Reviewed By: kcc, morehouse
Subscribers: llvm-commits, mgorny
Differential Revision: https://reviews.llvm.org/D40103
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk/lib/fuzzer@319680 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/FuzzerUtil.h b/FuzzerUtil.h
index 6cebd7c..9a6227e 100644
--- a/FuzzerUtil.h
+++ b/FuzzerUtil.h
@@ -13,6 +13,7 @@
#define LLVM_FUZZER_UTIL_H
#include "FuzzerDefs.h"
+#include "FuzzerCommand.h"
namespace fuzzer {
@@ -50,7 +51,7 @@
size_t GetPeakRSSMb();
-int ExecuteCommand(const std::string &Command);
+int ExecuteCommand(const Command &Cmd);
FILE *OpenProcessPipe(const char *Command, const char *Mode);