r365742 - Revert Recommit "[CommandLine] Remove OptionCategory and SubCommand caches from the Option class."

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 11 01:54:28 PDT 2019


Author: hokein
Date: Thu Jul 11 01:54:28 2019
New Revision: 365742

URL: http://llvm.org/viewvc/llvm-project?rev=365742&view=rev
Log:
Revert Recommit "[CommandLine] Remove OptionCategory and SubCommand caches from the Option class."

This reverts r365675 (git commit 43d75f977853c3ec891a440c362b2df183a211b5)

The patch causes a crash in SupportTests (CommandLineTest.AliasesWithArguments).

Modified:
    cfe/trunk/tools/clang-refactor/ClangRefactor.cpp

Modified: cfe/trunk/tools/clang-refactor/ClangRefactor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-refactor/ClangRefactor.cpp?rev=365742&r1=365741&r2=365742&view=diff
==============================================================================
--- cfe/trunk/tools/clang-refactor/ClangRefactor.cpp (original)
+++ cfe/trunk/tools/clang-refactor/ClangRefactor.cpp Thu Jul 11 01:54:28 2019
@@ -38,9 +38,11 @@ namespace opts {
 static cl::OptionCategory CommonRefactorOptions("Refactoring options");
 
 static cl::opt<bool> Verbose("v", cl::desc("Use verbose output"),
+                             cl::cat(cl::GeneralCategory),
                              cl::sub(*cl::AllSubCommands));
 
 static cl::opt<bool> Inplace("i", cl::desc("Inplace edit <file>s"),
+                             cl::cat(cl::GeneralCategory),
                              cl::sub(*cl::AllSubCommands));
 
 } // end namespace opts
@@ -609,7 +611,7 @@ int main(int argc, const char **argv) {
   ClangRefactorTool RefactorTool;
 
   CommonOptionsParser Options(
-      argc, argv, *cl::GeneralCategory, cl::ZeroOrMore,
+      argc, argv, cl::GeneralCategory, cl::ZeroOrMore,
       "Clang-based refactoring tool for C, C++ and Objective-C");
 
   if (auto Err = RefactorTool.Init()) {




More information about the cfe-commits mailing list