[clang] [frontend] sort big match clauses

Summary: Tidy up a couple of huge match clauses

Reviewed By: da319

Differential Revision: D26909264

fbshipit-source-id: 43d4753d1
master
Martin Trojer 4 years ago committed by Facebook GitHub Bot
parent 37d68c654e
commit 68ef8ab147

@ -209,8 +209,8 @@ let get_struct_decls decl =
let open Clang_ast_t in let open Clang_ast_t in
match decl with match decl with
| CapturedDecl (_, decl_list, _) | CapturedDecl (_, decl_list, _)
| ClassTemplateSpecializationDecl (_, _, _, decl_list, _, _, _, _, _, _)
| ClassTemplatePartialSpecializationDecl (_, _, _, decl_list, _, _, _, _, _, _) | ClassTemplatePartialSpecializationDecl (_, _, _, decl_list, _, _, _, _, _, _)
| ClassTemplateSpecializationDecl (_, _, _, decl_list, _, _, _, _, _, _)
| CXXRecordDecl (_, _, _, decl_list, _, _, _, _) | CXXRecordDecl (_, _, _, decl_list, _, _, _, _)
| EnumDecl (_, _, _, decl_list, _, _, _) | EnumDecl (_, _, _, decl_list, _, _, _)
| LinkageSpecDecl (_, decl_list, _) | LinkageSpecDecl (_, decl_list, _)
@ -224,70 +224,70 @@ let get_struct_decls decl =
| TranslationUnitDecl (_, decl_list, _, _) -> | TranslationUnitDecl (_, decl_list, _, _) ->
decl_list decl_list
| AccessSpecDecl _ | AccessSpecDecl _
| BindingDecl _
| BlockDecl _ | BlockDecl _
| ConceptDecl _ | BuiltinTemplateDecl _
| OMPDeclareMapperDecl _
| OMPAllocateDecl _
| ClassScopeFunctionSpecializationDecl _ | ClassScopeFunctionSpecializationDecl _
| ClassTemplateDecl _
| ConceptDecl _
| ConstructorUsingShadowDecl _
| CXXConstructorDecl _
| CXXConversionDecl _
| CXXDeductionGuideDecl _
| CXXDestructorDecl _
| CXXMethodDecl _
| DecompositionDecl _
| EmptyDecl _ | EmptyDecl _
| EnumConstantDecl _
| ExportDecl _ | ExportDecl _
| ExternCContextDecl _ | ExternCContextDecl _
| FieldDecl _
| FileScopeAsmDecl _ | FileScopeAsmDecl _
| FriendDecl _ | FriendDecl _
| FriendTemplateDecl _ | FriendTemplateDecl _
| FunctionDecl _
| FunctionTemplateDecl _
| ImplicitParamDecl _
| ImportDecl _ | ImportDecl _
| IndirectFieldDecl _
| LabelDecl _ | LabelDecl _
| LifetimeExtendedTemporaryDecl _
| MSPropertyDecl _
| NamespaceAliasDecl _ | NamespaceAliasDecl _
| NonTypeTemplateParmDecl _
| ObjCAtDefsFieldDecl _
| ObjCCompatibleAliasDecl _ | ObjCCompatibleAliasDecl _
| ObjCIvarDecl _
| ObjCMethodDecl _ | ObjCMethodDecl _
| ObjCPropertyDecl _ | ObjCPropertyDecl _
| BuiltinTemplateDecl _ | ObjCPropertyImplDecl _
| ClassTemplateDecl _ | ObjCTypeParamDecl _
| FunctionTemplateDecl _ | OMPAllocateDecl _
| TypeAliasTemplateDecl _ | OMPCapturedExprDecl _
| VarTemplateDecl _ | OMPDeclareMapperDecl _
| OMPDeclareReductionDecl _
| OMPRequiresDecl _
| OMPThreadPrivateDecl _
| ParmVarDecl _
| PragmaCommentDecl _
| PragmaDetectMismatchDecl _
| RequiresExprBodyDecl _
| StaticAssertDecl _
| TemplateTemplateParmDecl _ | TemplateTemplateParmDecl _
| TemplateTypeParmDecl _ | TemplateTypeParmDecl _
| ObjCTypeParamDecl _
| TypeAliasDecl _ | TypeAliasDecl _
| TypeAliasTemplateDecl _
| TypedefDecl _ | TypedefDecl _
| UnresolvedUsingTypenameDecl _ | UnresolvedUsingTypenameDecl _
| UnresolvedUsingValueDecl _
| UsingDecl _ | UsingDecl _
| UsingDirectiveDecl _ | UsingDirectiveDecl _
| UsingPackDecl _ | UsingPackDecl _
| UsingShadowDecl _ | UsingShadowDecl _
| ConstructorUsingShadowDecl _
| BindingDecl _
| FieldDecl _
| ObjCAtDefsFieldDecl _
| ObjCIvarDecl _
| FunctionDecl _
| CXXDeductionGuideDecl _
| CXXMethodDecl _
| CXXConstructorDecl _
| CXXConversionDecl _
| CXXDestructorDecl _
| MSPropertyDecl _
| NonTypeTemplateParmDecl _
| VarDecl _ | VarDecl _
| DecompositionDecl _ | VarTemplateDecl _
| ImplicitParamDecl _
| OMPCapturedExprDecl _
| ParmVarDecl _
| VarTemplateSpecializationDecl _
| VarTemplatePartialSpecializationDecl _ | VarTemplatePartialSpecializationDecl _
| EnumConstantDecl _ | VarTemplateSpecializationDecl _ ->
| IndirectFieldDecl _
| OMPDeclareReductionDecl _
| UnresolvedUsingValueDecl _
| OMPRequiresDecl _
| OMPThreadPrivateDecl _
| ObjCPropertyImplDecl _
| PragmaCommentDecl _
| PragmaDetectMismatchDecl _
| StaticAssertDecl _
| LifetimeExtendedTemporaryDecl _
| RequiresExprBodyDecl _ ->
[] []

@ -167,74 +167,74 @@ module CFrontend_decl_funct (T : CModule_type.CTranslation) : CModule_type.CFron
| EmptyDecl _ | ObjCIvarDecl _ | ObjCPropertyDecl _ | ObjCInterfaceDecl _ -> | EmptyDecl _ | ObjCIvarDecl _ | ObjCPropertyDecl _ | ObjCInterfaceDecl _ ->
() ()
| AccessSpecDecl _ | AccessSpecDecl _
| ConceptDecl _ | BindingDecl _
| OMPDeclareMapperDecl _
| OMPAllocateDecl _
| BlockDecl _ | BlockDecl _
| BuiltinTemplateDecl _
| CapturedDecl _ | CapturedDecl _
| ClassScopeFunctionSpecializationDecl _ | ClassScopeFunctionSpecializationDecl _
| ClassTemplateDecl _
| ClassTemplatePartialSpecializationDecl _
| ClassTemplateSpecializationDecl _
| ConceptDecl _
| ConstructorUsingShadowDecl _
| CXXDeductionGuideDecl _
| CXXRecordDecl _
| DecompositionDecl _
| EnumConstantDecl _
| EnumDecl _
| ExportDecl _ | ExportDecl _
| ExternCContextDecl _ | ExternCContextDecl _
| FieldDecl _
| FileScopeAsmDecl _ | FileScopeAsmDecl _
| FriendDecl _ | FriendDecl _
| FriendTemplateDecl _ | FriendTemplateDecl _
| FunctionDecl _
| FunctionTemplateDecl _
| ImplicitParamDecl _
| ImportDecl _ | ImportDecl _
| LinkageSpecDecl _ | IndirectFieldDecl _
| LabelDecl _ | LabelDecl _
| NamespaceDecl _ | LifetimeExtendedTemporaryDecl _
| LinkageSpecDecl _
| MSPropertyDecl _
| NamespaceAliasDecl _ | NamespaceAliasDecl _
| ObjCCompatibleAliasDecl _ | NamespaceDecl _
| NonTypeTemplateParmDecl _
| ObjCAtDefsFieldDecl _
| ObjCCategoryDecl _ | ObjCCategoryDecl _
| ObjCCategoryImplDecl _ | ObjCCategoryImplDecl _
| ObjCCompatibleAliasDecl _
| ObjCImplementationDecl _ | ObjCImplementationDecl _
| ObjCProtocolDecl _ | ObjCProtocolDecl _
| BuiltinTemplateDecl _ | ObjCTypeParamDecl _
| ClassTemplateDecl _ | OMPAllocateDecl _
| FunctionTemplateDecl _ | OMPCapturedExprDecl _
| TypeAliasTemplateDecl _ | OMPDeclareMapperDecl _
| VarTemplateDecl _ | OMPDeclareReductionDecl _
| TemplateTemplateParmDecl _ | OMPRequiresDecl _
| EnumDecl _ | OMPThreadPrivateDecl _
| ParmVarDecl _
| PragmaCommentDecl _
| PragmaDetectMismatchDecl _
| RecordDecl _ | RecordDecl _
| CXXRecordDecl _ | RequiresExprBodyDecl _
| ClassTemplateSpecializationDecl _ | StaticAssertDecl _
| ClassTemplatePartialSpecializationDecl _ | TemplateTemplateParmDecl _
| TemplateTypeParmDecl _ | TemplateTypeParmDecl _
| ObjCTypeParamDecl _ | TranslationUnitDecl _
| TypeAliasDecl _ | TypeAliasDecl _
| TypeAliasTemplateDecl _
| TypedefDecl _ | TypedefDecl _
| UnresolvedUsingTypenameDecl _ | UnresolvedUsingTypenameDecl _
| UnresolvedUsingValueDecl _
| UsingDecl _ | UsingDecl _
| UsingDirectiveDecl _ | UsingDirectiveDecl _
| UsingPackDecl _ | UsingPackDecl _
| UsingShadowDecl _ | UsingShadowDecl _
| ConstructorUsingShadowDecl _
| BindingDecl _
| FieldDecl _
| ObjCAtDefsFieldDecl _
| FunctionDecl _
| CXXDeductionGuideDecl _
| MSPropertyDecl _
| NonTypeTemplateParmDecl _
| VarDecl _ | VarDecl _
| DecompositionDecl _ | VarTemplateDecl _
| ImplicitParamDecl _
| OMPCapturedExprDecl _
| ParmVarDecl _
| VarTemplateSpecializationDecl _
| VarTemplatePartialSpecializationDecl _ | VarTemplatePartialSpecializationDecl _
| EnumConstantDecl _ | VarTemplateSpecializationDecl _ ->
| IndirectFieldDecl _
| OMPDeclareReductionDecl _
| UnresolvedUsingValueDecl _
| OMPRequiresDecl _
| OMPThreadPrivateDecl _
| PragmaCommentDecl _
| PragmaDetectMismatchDecl _
| StaticAssertDecl _
| TranslationUnitDecl _
| LifetimeExtendedTemporaryDecl _
| RequiresExprBodyDecl _ ->
(* TODO: some form of logging *) (* TODO: some form of logging *)
() ()

@ -4535,22 +4535,23 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s
instr instr
(Pp.of_string ~f:Clang_ast_j.string_of_stmt) (Pp.of_string ~f:Clang_ast_j.string_of_stmt)
instr instr
| MSAsmStmt _
| CapturedStmt _
| CoreturnStmt _
| CoroutineBodyStmt _
| AddrLabelExpr _ | AddrLabelExpr _
| ArrayTypeTraitExpr _ | ArrayTypeTraitExpr _
| AsTypeExpr _ | AsTypeExpr _
| AtomicExpr _ | AtomicExpr _
| CXXFoldExpr _ | CapturedStmt _
| CXXUnresolvedConstructExpr _
| CXXUuidofExpr _
| CUDAKernelCallExpr _
| ChooseExpr _ | ChooseExpr _
| ConvertVectorExpr _
| CoawaitExpr _ | CoawaitExpr _
| ConceptSpecializationExpr _
| ConvertVectorExpr _
| CoreturnStmt _
| CoroutineBodyStmt _
| CoyieldExpr _ | CoyieldExpr _
| CUDAKernelCallExpr _
| CXXFoldExpr _
| CXXRewrittenBinaryOperator _
| CXXUnresolvedConstructExpr _
| CXXUuidofExpr _
| DependentCoawaitExpr _ | DependentCoawaitExpr _
| DependentScopeDeclRefExpr _ | DependentScopeDeclRefExpr _
| DesignatedInitExpr _ | DesignatedInitExpr _
@ -4559,52 +4560,41 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s
| ExtVectorElementExpr _ | ExtVectorElementExpr _
| FunctionParmPackExpr _ | FunctionParmPackExpr _
| ImaginaryLiteral _ | ImaginaryLiteral _
| IndirectGotoStmt _
| MSAsmStmt _
| MSDependentExistsStmt _
| MSPropertyRefExpr _ | MSPropertyRefExpr _
| MSPropertySubscriptExpr _ | MSPropertySubscriptExpr _
| NoInitExpr _ | NoInitExpr _
| OMPArraySectionExpr _
| ObjCIsaExpr _ | ObjCIsaExpr _
| ObjCSubscriptRefExpr _ | ObjCSubscriptRefExpr _
| UnresolvedLookupExpr _ | OMPArraySectionExpr _
| UnresolvedMemberExpr _
| PackExpansionExpr _
| ParenListExpr _
| TypoExpr _
| IndirectGotoStmt _
| MSDependentExistsStmt _
| OMPAtomicDirective _ | OMPAtomicDirective _
| OMPBarrierDirective _ | OMPBarrierDirective _
| OMPCancelDirective _ | OMPCancelDirective _
| OMPCancellationPointDirective _ | OMPCancellationPointDirective _
| OMPCriticalDirective _ | OMPCriticalDirective _
| OMPFlushDirective _
| OMPDistributeDirective _ | OMPDistributeDirective _
| OMPDistributeParallelForDirective _ | OMPDistributeParallelForDirective _
| OMPDistributeParallelForSimdDirective _ | OMPDistributeParallelForSimdDirective _
| OMPDistributeSimdDirective _ | OMPDistributeSimdDirective _
| OMPFlushDirective _
| OMPForDirective _ | OMPForDirective _
| OMPForSimdDirective _ | OMPForSimdDirective _
| OMPParallelForDirective _
| OMPParallelForSimdDirective _
| OMPSimdDirective _
| OMPTargetParallelForSimdDirective _
| OMPTargetSimdDirective _
| OMPTargetTeamsDistributeDirective _
| OMPTargetTeamsDistributeParallelForDirective _
| OMPTargetTeamsDistributeParallelForSimdDirective _
| OMPTargetTeamsDistributeSimdDirective _
| OMPTaskLoopDirective _
| OMPTaskLoopSimdDirective _
| OMPTeamsDistributeDirective _
| OMPTeamsDistributeParallelForDirective _
| OMPTeamsDistributeParallelForSimdDirective _
| OMPTeamsDistributeSimdDirective _
| OMPMasterDirective _ | OMPMasterDirective _
| OMPMasterTaskLoopDirective _
| OMPMasterTaskLoopSimdDirective _
| OMPOrderedDirective _ | OMPOrderedDirective _
| OMPParallelDirective _ | OMPParallelDirective _
| OMPParallelForDirective _
| OMPParallelForSimdDirective _
| OMPParallelMasterDirective _
| OMPParallelMasterTaskLoopDirective _
| OMPParallelMasterTaskLoopSimdDirective _
| OMPParallelSectionsDirective _ | OMPParallelSectionsDirective _
| OMPSectionDirective _ | OMPSectionDirective _
| OMPSectionsDirective _ | OMPSectionsDirective _
| OMPSimdDirective _
| OMPSingleDirective _ | OMPSingleDirective _
| OMPTargetDataDirective _ | OMPTargetDataDirective _
| OMPTargetDirective _ | OMPTargetDirective _
@ -4612,27 +4602,37 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s
| OMPTargetExitDataDirective _ | OMPTargetExitDataDirective _
| OMPTargetParallelDirective _ | OMPTargetParallelDirective _
| OMPTargetParallelForDirective _ | OMPTargetParallelForDirective _
| OMPTargetParallelForSimdDirective _
| OMPTargetSimdDirective _
| OMPTargetTeamsDirective _ | OMPTargetTeamsDirective _
| OMPTargetTeamsDistributeDirective _
| OMPTargetTeamsDistributeParallelForDirective _
| OMPTargetTeamsDistributeParallelForSimdDirective _
| OMPTargetTeamsDistributeSimdDirective _
| OMPTargetUpdateDirective _ | OMPTargetUpdateDirective _
| OMPTaskDirective _ | OMPTaskDirective _
| OMPTaskgroupDirective _ | OMPTaskgroupDirective _
| OMPTaskLoopDirective _
| OMPTaskLoopSimdDirective _
| OMPTaskwaitDirective _ | OMPTaskwaitDirective _
| OMPTaskyieldDirective _ | OMPTaskyieldDirective _
| OMPTeamsDirective _ | OMPTeamsDirective _
| OMPMasterTaskLoopDirective _ | OMPTeamsDistributeDirective _
| OMPMasterTaskLoopSimdDirective _ | OMPTeamsDistributeParallelForDirective _
| OMPParallelMasterTaskLoopDirective _ | OMPTeamsDistributeParallelForSimdDirective _
| OMPParallelMasterTaskLoopSimdDirective _ | OMPTeamsDistributeSimdDirective _
| OMPParallelMasterDirective _ | PackExpansionExpr _
| CXXRewrittenBinaryOperator _ | ParenListExpr _
| ConceptSpecializationExpr _
| RequiresExpr _ | RequiresExpr _
| SourceLocExpr _
| SEHExceptStmt _ | SEHExceptStmt _
| SEHFinallyStmt _ | SEHFinallyStmt _
| SEHLeaveStmt _ | SEHLeaveStmt _
| SEHTryStmt _ | SEHTryStmt _
| ShuffleVectorExpr _ -> | ShuffleVectorExpr _
| SourceLocExpr _
| TypoExpr _
| UnresolvedLookupExpr _
| UnresolvedMemberExpr _ ->
let (stmt_info, stmts), ret_typ = let (stmt_info, stmts), ret_typ =
match Clang_ast_proj.get_expr_tuple instr with match Clang_ast_proj.get_expr_tuple instr with
| Some (stmt_info, stmts, expr_info) -> | Some (stmt_info, stmts, expr_info) ->

Loading…
Cancel
Save