[llvm-mc-fuzzer] Fix -jobs option.

The fuzzer argument parser will ignore all options starting with '--' so
operation mode options should begin with '--' and fuzzer options should begin
with '-'. Fuzzer arguments must still follow --fuzzer-args so that they escape
the parsing performed by the CommandLine library.

llvm-svn: 248671
This commit is contained in:
Daniel Sanders 2015-09-26 17:09:01 +00:00
parent caac2b6930
commit 4fe1c8b24e
2 changed files with 6 additions and 8 deletions

View File

@ -361,11 +361,12 @@ When run in dissassembly mode, the inputs are opcodes to be disassembled. The
fuzzer will consume as many instructions as possible and will stop when it
finds an invalid instruction or runs out of data.
Please note that the command line interface differs from that of other fuzzers.
The fuzzer arguments are specified with ``-fuzzer-args`` while other arguments
control the operation mode and target in a similar manner to ``llvm-mc``.
Please note that the command line interface differs slightly from that of other
fuzzers. The fuzzer arguments should follow ``--fuzzer-args`` and should have
a single dash, while other arguments control the operation mode and target in a
similar manner to ``llvm-mc`` and should have two dashes. For example::
Unfortunately, this fuzzer is currently unable to use the -jobs option.
llvm-mc-fuzzer --triple=aarch64-linux-gnu --disassemble --fuzzer-args -max_len=4 -jobs=10
Buildbot
--------

View File

@ -127,13 +127,10 @@ int main(int argc, char **argv) {
FeaturesStr = Features.getString();
}
// Insert the program name into the FuzzerArgv.
FuzzerArgv.insert(FuzzerArgv.begin(), argv[0]);
if (Action == AC_Assemble)
errs() << "error: -assemble is not implemented\n";
else if (Action == AC_Disassemble)
return fuzzer::FuzzerDriver(FuzzerArgv, DisassembleOneInput);
return fuzzer::FuzzerDriver(argc, argv, DisassembleOneInput);
llvm_unreachable("Unknown action");
return 1;