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

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

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

Loading…
Cancel
Save