Skip to content

Commit

Permalink
Xforce-jit should allow multiple occurrences.
Browse files Browse the repository at this point in the history
Summary:
The SH dev wiki has this command for testing the JIT:
```
LIT_HERMES_EXTRA_FLAGS=-Xforce-jit ninja check-hermes
```
However, that command current produces 28 errors.  Fortunately,
they're all trivial.  They are all tests in the test/jit directory,
which already have an explicit -Xforce-jit in their run lines.  The
addition of the LIT_HERMES_EXTRA_FLAGS causes:
```
hermes: for the -Xforce-jit option: may only occur zero or one times!
```
The fix is simple: declare this option to be ZeroOrMore, instead of
Optional.

Aakash asks about the behavior of ZeroOrMore if there are
multiple occurrences.  From:

https://llvm.org/docs/CommandLine.html#controlling-the-number-of-occurrences-required-and-allowed

> If an option is specified multiple times for an option of the cl::opt class, only the last value will be retained.

Reviewed By: avp

Differential Revision: D65950456

fbshipit-source-id: b0fe60d42239d1b742a076d72c78c85d61550adc
  • Loading branch information
David Detlefs authored and facebook-github-bot committed Nov 14, 2024
1 parent 421de3e commit 2112e3f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions include/hermes/VM/RuntimeFlags.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ struct VMOnlyRuntimeFlags {
llvh::cl::opt<bool> ForceJIT{
"Xforce-jit",
llvh::cl::Hidden,
llvh::cl::ZeroOrMore,
llvh::cl::cat(RuntimeCategory),
llvh::cl::desc("force JIT compilation of every function"),
llvh::cl::init(false)};
Expand Down

0 comments on commit 2112e3f

Please sign in to comment.