OSDN Git Service

FuzzMutate: Fix arch parsing in FuzzerCLI
authorJustin Bogner <mail@justinbogner.com>
Tue, 17 Oct 2017 02:39:40 +0000 (02:39 +0000)
committerJustin Bogner <mail@justinbogner.com>
Tue, 17 Oct 2017 02:39:40 +0000 (02:39 +0000)
The right way to parse arch names is by creating a triple. This was
using getArchTypeForLLVMName before, which doesn't really do the right
thing here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315965 91177308-0d34-0410-b5e6-96231b3b80d8

lib/FuzzMutate/FuzzerCLI.cpp

index a92b6c0..ef6958e 100644 (file)
@@ -47,7 +47,7 @@ void llvm::handleExecNameEncodedBEOpts(StringRef ExecName) {
       Args.push_back("-O0");
     } else if (Opt.startswith("O")) {
       Args.push_back("-" + Opt.str());
-    } else if (Triple::getArchTypeForLLVMName(Opt)) {
+    } else if (Triple(Opt).getArch()) {
       Args.push_back("-mtriple=" + Opt.str());
     } else {
       errs() << ExecName << ": Unknown option: " << Opt << ".\n";