diff options
author | Mingming Liu <mingmingl@google.com> | 2023-11-10 11:44:30 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-10 11:44:30 -0800 |
commit | 2e912a2b82dde3940e77b62832629ecf0a8b9f14 (patch) | |
tree | 573551218a175d5875fc3b50293767f85252e0f5 /llvm/lib/Support/CommandLine.cpp | |
parent | f2f5f1bfb6fa01177f3607301909b6c8f58bd1cd (diff) | |
download | llvm-2e912a2b82dde3940e77b62832629ecf0a8b9f14.zip llvm-2e912a2b82dde3940e77b62832629ecf0a8b9f14.tar.gz llvm-2e912a2b82dde3940e77b62832629ecf0a8b9f14.tar.bz2 |
Revert "[Support]Look up in top-level subcommand as a fallback when looking options for a custom subcommand (#71975)
…ooking options for a custom subcommand. (#71776)"
This reverts commit b88308b1b4813e55ce8f54ceff6e57736328fb58.
The build-bot is unhappy
(https://lab.llvm.org/buildbot/#/builders/186/builds/13096),
`GroupingAndPrefix` fails after `TopLevelOptInSubcommand` (the newly
added test).
Revert while I look into this (might be related with test sharding but
not sure)
```
[----------] 3 tests from CommandLineTest
[ RUN ] CommandLineTest.TokenizeWindowsCommandLine2
[ OK ] CommandLineTest.TokenizeWindowsCommandLine2 (0 ms)
[ RUN ] CommandLineTest.TopLevelOptInSubcommand
[ OK ] CommandLineTest.TopLevelOptInSubcommand (0 ms)
[ RUN ] CommandLineTest.GroupingAndPrefix
#0 0x00ba8118 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x594118)
#1 0x00ba5914 llvm::sys::RunSignalHandlers() (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x591914)
#2 0x00ba89c4 SignalHandler(int) (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x5949c4)
#3 0xf7828530 __default_sa_restorer /build/glibc-9MGTF6/glibc-2.31/signal/../sysdeps/unix/sysv/linux/arm/sigrestorer.S:67:0
#4 0x00af91f0 (anonymous namespace)::CommandLineParser::ResetAllOptionOccurrences() (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x4e51f0)
#5 0x00af8e1c llvm::cl::ResetCommandLineParser() (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x4e4e1c)
#6 0x0077cda0 (anonymous namespace)::CommandLineTest_GroupingAndPrefix_Test::TestBody() (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x168da0)
#7 0x00bc5adc testing::Test::Run() (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x5b1adc)
#8 0x00bc6cc0 testing::TestInfo::Run() (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x5b2cc0)
#9 0x00bc7880 testing::TestSuite::Run() (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x5b3880)
#10 0x00bd7974 testing::internal::UnitTestImpl::RunAllTests() (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x5c3974)
#11 0x00bd6ebc testing::UnitTest::Run() (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x5c2ebc)
#12 0x00bb1058 main (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x59d058)
#13 0xf78185a4 __libc_start_main /build/glibc-9MGTF6/glibc-2.31/csu/libc-start.c:342:3
```
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
-rw-r--r-- | llvm/lib/Support/CommandLine.cpp | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp index a7e0cae..55633d7 100644 --- a/llvm/lib/Support/CommandLine.cpp +++ b/llvm/lib/Support/CommandLine.cpp @@ -1667,13 +1667,6 @@ bool CommandLineParser::ParseCommandLineOptions(int argc, Handler = LookupLongOption(*ChosenSubCommand, ArgName, Value, LongOptionsUseDoubleDash, HaveDoubleDash); - // If Handler is not found in a specialized subcommand, look up handler - // in the top-level subcommand. - // cl::opt without cl::sub belongs to top-level subcommand. - if (!Handler && ChosenSubCommand != &SubCommand::getTopLevel()) - Handler = LookupLongOption(SubCommand::getTopLevel(), ArgName, Value, - LongOptionsUseDoubleDash, HaveDoubleDash); - // Check to see if this "option" is really a prefixed or grouped argument. if (!Handler && !(LongOptionsUseDoubleDash && HaveDoubleDash)) Handler = HandlePrefixedOrGroupedOption(ArgName, Value, ErrorParsing, |