summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Fuzzer/FuzzerUtil.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerUtil.h')
-rw-r--r--llvm/lib/Fuzzer/FuzzerUtil.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerUtil.h b/llvm/lib/Fuzzer/FuzzerUtil.h
index c9fb1c12e08..62d6e61dcf1 100644
--- a/llvm/lib/Fuzzer/FuzzerUtil.h
+++ b/llvm/lib/Fuzzer/FuzzerUtil.h
@@ -67,6 +67,14 @@ inline std::string CloneArgsWithoutX(const std::vector<std::string> &Args,
return CloneArgsWithoutX(Args, X, X);
}
+inline std::pair<std::string, std::string> SplitBefore(std::string X,
+ std::string S) {
+ auto Pos = S.find(X);
+ if (Pos == std::string::npos)
+ return std::make_pair(S, "");
+ return std::make_pair(S.substr(0, Pos), S.substr(Pos));
+}
+
std::string DisassembleCmd(const std::string &FileName);
std::string SearchRegexCmd(const std::string &Regex);
OpenPOWER on IntegriCloud