From: Haojian Wu Date: Thu, 11 Jul 2019 08:54:28 +0000 (+0000) Subject: Revert Recommit "[CommandLine] Remove OptionCategory and SubCommand caches from the... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8734d09a4ec7e197df9fc0448f7ced7bdca17021;p=clang 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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365742 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/clang-refactor/ClangRefactor.cpp b/tools/clang-refactor/ClangRefactor.cpp index 08963001cc..f7ca39fcfe 100644 --- a/tools/clang-refactor/ClangRefactor.cpp +++ b/tools/clang-refactor/ClangRefactor.cpp @@ -38,9 +38,11 @@ namespace opts { static cl::OptionCategory CommonRefactorOptions("Refactoring options"); static cl::opt Verbose("v", cl::desc("Use verbose output"), + cl::cat(cl::GeneralCategory), cl::sub(*cl::AllSubCommands)); static cl::opt Inplace("i", cl::desc("Inplace edit 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()) {