[PATCH] D106334: Initialize common options in `getRegisteredOptions`

Senran Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 19 19:38:06 PDT 2021


zsrkmyn created this revision.
zsrkmyn added reviewers: mehdi_amini, jhenderson, jpienaar, MaskRay.
Herald added subscribers: dexonsmith, hiraditya.
zsrkmyn requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This allows users accessing options in libSupport before invoking
`cl::ParseCommandLineOptions`, and also matches the behavior before
D105959 <https://reviews.llvm.org/D105959>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D106334

Files:
  llvm/lib/Support/CommandLine.cpp


Index: llvm/lib/Support/CommandLine.cpp
===================================================================
--- llvm/lib/Support/CommandLine.cpp
+++ llvm/lib/Support/CommandLine.cpp
@@ -2633,6 +2633,7 @@
 }
 
 StringMap<Option *> &cl::getRegisteredOptions(SubCommand &Sub) {
+  initCommonOptions();
   auto &Subs = GlobalParser->RegisteredSubCommands;
   (void)Subs;
   assert(is_contained(Subs, &Sub));


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106334.359986.patch
Type: text/x-patch
Size: 404 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210720/ee0e4586/attachment.bin>


More information about the llvm-commits mailing list