[clang] 396d6a3 - [clang][cli] Store unsigned instead of OptSpecifier in table

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 9 06:47:51 PST 2021


Author: Jan Svoboda
Date: 2021-02-09T15:46:10+01:00
New Revision: 396d6a3220ee131f58ce46ca47f6f98cf7a3fcae

URL: https://github.com/llvm/llvm-project/commit/396d6a3220ee131f58ce46ca47f6f98cf7a3fcae
DIFF: https://github.com/llvm/llvm-project/commit/396d6a3220ee131f58ce46ca47f6f98cf7a3fcae.diff

LOG: [clang][cli] Store unsigned instead of OptSpecifier in table

This fixes some buildbot failures with ambiguous call to OptSpecifier constructor.

Added: 
    

Modified: 
    clang/lib/Frontend/CompilerInvocation.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index d9df4da25eea..9cdaab8804d8 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -2158,7 +2158,7 @@ static bool parseTestModuleFileExtensionArg(StringRef Arg,
 /// intentionally missing, as this case is handled separately from other
 /// frontend options.
 static const auto &getFrontendActionTable() {
-  static const std::pair<frontend::ActionKind, OptSpecifier> Table[] = {
+  static const std::pair<frontend::ActionKind, unsigned> Table[] = {
       {frontend::ASTDeclList, OPT_ast_list},
 
       {frontend::ASTDump, OPT_ast_dump_all_EQ},
@@ -2213,7 +2213,7 @@ static const auto &getFrontendActionTable() {
 /// Maps command line option to frontend action.
 static Optional<frontend::ActionKind> getFrontendAction(OptSpecifier &Opt) {
   for (const auto &ActionOpt : getFrontendActionTable())
-    if (ActionOpt.second == Opt)
+    if (ActionOpt.second == Opt.getID())
       return ActionOpt.first;
 
   return None;


        


More information about the cfe-commits mailing list