Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow square brackets to specify options in a subset #7260

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions compiler/control/OMROptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2003,7 +2003,7 @@ OMR::Options::latePostProcess(TR::Options *options, void *jitConfig, bool isAOT)
{
optionSet->setOptions(newOptions);
subOpts = TR::Options::processOptionSet(subOpts, optionSet, optionSet->getOptions(), isAOT);
if (*subOpts != ')')
if (*subOpts != ')' && *subOpts != ']')
return subOpts;
if (!optionSet->getOptions()->jitLatePostProcess(optionSet, jitConfig))
return options->_startOptions;
Expand Down Expand Up @@ -3316,7 +3316,7 @@ OMR::Options::processOptionSet(
void *jitBase,
bool isAOT)
{
while (*options && *options != ')')
while (*options && *options != ')' && *options != ']')
{
const char *endOpt = NULL;
const char *filterHeader = NULL;
Expand Down Expand Up @@ -3428,15 +3428,17 @@ OMR::Options::processOptionSet(
//
if (endOpt)
{
if (*endOpt != '(')
if (*endOpt != '(' && *endOpt != '[')
return options;
const char bracket = *endOpt;
const char matchingBracket = (bracket == '(') ? ')' : ']';
const char *startOptString = ++endOpt;
int32_t parenNest = 1;
for (; *endOpt; endOpt++)
{
if (*endOpt == '(')
if (*endOpt == bracket)
parenNest++;
else if (*endOpt == ')')
else if (*endOpt == matchingBracket)
{
if (--parenNest == 0)
{
Expand Down Expand Up @@ -3530,7 +3532,7 @@ OMR::Options::processOptionSet(
options = endOpt+1;
continue;
}
else if (*endOpt && *endOpt != ')')
else if (*endOpt && *endOpt != ')' && *endOpt != ']')
{
return options; // Missing separator
}
Expand Down
Loading