bugpoint: accept quoted strings in -grep.
authorwhitequark <whitequark@whitequark.org>
Mon, 7 Dec 2020 08:23:32 +0000 (08:23 +0000)
committerwhitequark <whitequark@whitequark.org>
Mon, 7 Dec 2020 08:42:54 +0000 (08:42 +0000)
passes/cmds/bugpoint.cc

index d32d33560d0b5d21fd965cf3e17a36a9765f1d69..8197b21f71638f63b0af28f358c877959f45dc45 100644 (file)
@@ -45,7 +45,7 @@ struct BugpointPass : public Pass {
                log("    -yosys <filename>\n");
                log("        use this Yosys binary. if not specified, `yosys` is used.\n");
                log("\n");
-               log("    -grep <string>\n");
+               log("    -grep \"<string>\"\n");
                log("        only consider crashes that place this string in the log file.\n");
                log("\n");
                log("    -fast\n");
@@ -102,6 +102,9 @@ struct BugpointPass : public Pass {
                if (grep.empty())
                        return true;
 
+               if (grep.size() > 2 && grep.front() == '"' && grep.back() == '"')
+                       grep = grep.substr(1, grep.size() - 2);
+
                std::ifstream f("bugpoint-case.log");
                while (!f.eof())
                {