about summary refs log tree commit diff homepage
path: root/tools
diff options
context:
space:
mode:
authorCristian Cadar <c.cadar@imperial.ac.uk>2014-09-15 10:41:31 +0100
committerCristian Cadar <c.cadar@imperial.ac.uk>2014-09-15 10:41:31 +0100
commit543bb5d7fef5d039d3a6f2a65a0a16a76068f864 (patch)
treee2b0b7f659ceb70ec0515b924d316419776c464f /tools
parent8cf057d9b76ab93e35c9542235a4db144671a4e6 (diff)
parent6f02157445810c630a7ca5684ff62a67bf22b87c (diff)
downloadklee-543bb5d7fef5d039d3a6f2a65a0a16a76068f864.tar.gz
Merge pull request #158 from delcypher/remove_response_files
Remove --read-args command line option because this feature has been
Diffstat (limited to 'tools')
-rw-r--r--tools/klee/main.cpp44
1 files changed, 3 insertions, 41 deletions
diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp
index dcaa458a..a7f2fbc6 100644
--- a/tools/klee/main.cpp
+++ b/tools/klee/main.cpp
@@ -164,11 +164,6 @@ namespace {
             cl::desc("Directory to write results in (defaults to klee-out-N)"),
             cl::init(""));
 
-  // this is a fake entry, its automagically handled
-  cl::list<std::string>
-  ReadArgsFilesFake("read-args", 
-                    cl::desc("File to read arguments from (one arg per line)"));
-    
   cl::opt<bool>
   ReplayKeepSymbolic("replay-keep-symbolic", 
                      cl::desc("Replay the test cases only by asserting "
@@ -619,48 +614,15 @@ static std::string strip(std::string &in) {
   return in.substr(lead, trail-lead);
 }
 
-static void readArgumentsFromFile(char *file, std::vector<std::string> &results) {
-  std::ifstream f(file);
-  assert(f.is_open() && "unable to open input for reading arguments");
-  while (!f.eof()) {
-    std::string line;
-    std::getline(f, line);
-    line = strip(line);
-    if (!line.empty())
-      results.push_back(line);
-  }
-  f.close();
-}
-
 static void parseArguments(int argc, char **argv) {
-  std::vector<std::string> arguments;
-
-  for (int i=1; i<argc; i++) {
-    if (!strcmp(argv[i],"--read-args") && i+1<argc) {
-      readArgumentsFromFile(argv[++i], arguments);
-    } else {
-      arguments.push_back(argv[i]);
-    }
-  }
-    
-  int numArgs = arguments.size() + 1;
-  const char **argArray = new const char*[numArgs+1];
-  argArray[0] = argv[0];
-  argArray[numArgs] = 0;
-  for (int i=1; i<numArgs; i++) {
-    argArray[i] = arguments[i-1].c_str();
-  }
-
 #if LLVM_VERSION_CODE >= LLVM_VERSION(3, 2)
-  cl::ParseCommandLineOptions(numArgs, (const char**) argArray, " klee\n");
+  // This version always reads response files
+  cl::ParseCommandLineOptions(argc, (const char**) argv, " klee\n");
 #else
-  cl::ParseCommandLineOptions(numArgs, (char**) argArray, " klee\n");
+  cl::ParseCommandLineOptions(argc, (char**) argv, " klee\n", /*ReadResponseFiles=*/ true);
 #endif
-  delete[] argArray;
 }
 
-
-
 static int initEnv(Module *mainModule) {
 
   /*