From ee2dcdc3df7941b6fe6bf16b8ddadb3b8939f7e0 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 22 Dec 2022 21:03:22 -0500 Subject: [PATCH] panfrost: Add clang-format file Based on freedreno settings, tweaked for panfrost's foreach macros. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/.clang-format | 144 +++++++++++++++++++++ src/panfrost/.clang-format | 144 +++++++++++++++++++++ 2 files changed, 288 insertions(+) create mode 100644 src/gallium/drivers/panfrost/.clang-format create mode 100644 src/panfrost/.clang-format diff --git a/src/gallium/drivers/panfrost/.clang-format b/src/gallium/drivers/panfrost/.clang-format new file mode 100644 index 00000000000..2d75ff1089f --- /dev/null +++ b/src/gallium/drivers/panfrost/.clang-format @@ -0,0 +1,144 @@ +AlignAfterOpenBracket: true +AlignConsecutiveMacros: true +AlignConsecutiveBitFields: true +AllowAllArgumentsOnNextLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: false +AlwaysBreakAfterReturnType: TopLevelDefinitions +BasedOnStyle: LLVM +BraceWrapping: + AfterControlStatement: false + AfterEnum: false + AfterFunction: true + AfterStruct: false + BeforeElse: false + SplitEmptyFunction: true +BinPackArguments: true +BinPackParameters: true +BreakBeforeBraces: Custom +ColumnLimit: 80 +ContinuationIndentWidth: 3 +Cpp11BracedListStyle: false +Cpp11BracedListStyle: true +BreakStringLiterals: false +ForEachMacros: + - BITSET_FOREACH_SET + - BITSET_FOREACH_RANGE + - LIST_FOR_EACH_ENTRY + - LIST_FOR_EACH_ENTRY_SAFE + - LIST_FOR_EACH_ENTRY_SAFE_REV + - list_for_each_entry + - list_for_each_entry_safe + - list_for_each_entry_rev + - list_for_each_entry_rev_safe + - list_for_each_entry_from + - list_for_each_entry_from_rev + - foreach_list_typed + - u_foreach_bit + - util_dynarray_foreach + - rb_tree_foreach + - rb_tree_foreach_safe + - nir_foreach_variable + - nir_foreach_variable_safe + - nir_foreach_uniform_variable + - nir_foreach_uniform_variable_safe + - nir_foreach_register + - nir_foreach_register_safe + - nir_foreach_use + - nir_foreach_use_safe + - nir_foreach_if_use + - nir_foreach_if_use_safe + - nir_foreach_def + - nir_foreach_def_safe + - nir_foreach_phi_src + - nir_foreach_phi_src_safe + - nir_foreach_parallel_copy_entry + - nir_foreach_instr + - nir_foreach_instr_reverse + - nir_foreach_instr_safe + - nir_foreach_instr_reverse_safe + - nir_foreach_instr_from_safe + - nir_foreach_function + - nir_foreach_block + - nir_foreach_block_safe + - nir_foreach_block_reverse + - nir_foreach_block_reverse_safe + - nir_foreach_block_in_cf_node + - nir_foreach_shader_in_variable + - nir_foreach_shader_out_variable_safe + - nir_foreach_variable_in_list + - nir_foreach_variable_with_modes_safe + - nir_foreach_variable_with_modes + - nir_foreach_shader_out_variable + - foreach_batch + - hash_table_foreach + - set_foreach + - pan_pack + - pan_section_pack + - bi_foreach_block + - bi_foreach_block_from + - bi_foreach_block_from_rev + - bi_foreach_block_rev + - bi_foreach_clause_in_block + - bi_foreach_clause_in_block_from + - bi_foreach_clause_in_block_from_rev + - bi_foreach_clause_in_block_rev + - bi_foreach_clause_in_block_safe + - bi_foreach_dest + - bi_foreach_instr_and_src_in_tuple + - bi_foreach_instr_global + - bi_foreach_instr_global_rev + - bi_foreach_instr_global_rev_safe + - bi_foreach_instr_global_safe + - bi_foreach_instr_in_block + - bi_foreach_instr_in_block_from + - bi_foreach_instr_in_block_from_rev + - bi_foreach_instr_in_block_rev + - bi_foreach_instr_in_block_safe + - bi_foreach_instr_in_block_safe_rev + - bi_foreach_instr_in_clause + - bi_foreach_instr_in_clause_rev + - bi_foreach_instr_in_tuple + - bi_foreach_predecessor + - bi_foreach_src + - bi_foreach_ssa_src + - bi_foreach_successor + - mir_foreach_block + - mir_foreach_block_from + - mir_foreach_bundle_in_block + - mir_foreach_bundle_in_block_rev + - mir_foreach_instr_global + - mir_foreach_instr_global_safe + - mir_foreach_instr_in_block + - mir_foreach_instr_in_block_from + - mir_foreach_instr_in_block_from_rev + - mir_foreach_instr_in_block_rev + - mir_foreach_instr_in_block_safe + - mir_foreach_instr_in_block_safe_rev + - mir_foreach_instr_in_block_scheduled_rev + - mir_foreach_predecessor + - mir_foreach_src + - nodearray_dense_foreach + - nodearray_dense_foreach_64 + - nodearray_sparse_foreach + - pan_foreach_instr_in_block_rev + - pan_foreach_predecessor + - pan_foreach_successor + +IncludeBlocks: Preserve +IncludeCategories: + - Regex: '<[[:alnum:].]+>' + Priority: 1 + - Regex: '.*\/.*' + Priority: 2 + - Regex: '.*' + Priority: 3 +IndentWidth: 3 +PenaltyBreakBeforeFirstCallParameter: 1 +PenaltyExcessCharacter: 100 +SpaceAfterCStyleCast: false +SpaceBeforeCpp11BracedList: false +SpaceBeforeParens: ControlStatementsExceptControlMacros +SpaceBeforeCtorInitializerColon: false +SpacesInContainerLiterals: false + diff --git a/src/panfrost/.clang-format b/src/panfrost/.clang-format new file mode 100644 index 00000000000..2d75ff1089f --- /dev/null +++ b/src/panfrost/.clang-format @@ -0,0 +1,144 @@ +AlignAfterOpenBracket: true +AlignConsecutiveMacros: true +AlignConsecutiveBitFields: true +AllowAllArgumentsOnNextLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: false +AlwaysBreakAfterReturnType: TopLevelDefinitions +BasedOnStyle: LLVM +BraceWrapping: + AfterControlStatement: false + AfterEnum: false + AfterFunction: true + AfterStruct: false + BeforeElse: false + SplitEmptyFunction: true +BinPackArguments: true +BinPackParameters: true +BreakBeforeBraces: Custom +ColumnLimit: 80 +ContinuationIndentWidth: 3 +Cpp11BracedListStyle: false +Cpp11BracedListStyle: true +BreakStringLiterals: false +ForEachMacros: + - BITSET_FOREACH_SET + - BITSET_FOREACH_RANGE + - LIST_FOR_EACH_ENTRY + - LIST_FOR_EACH_ENTRY_SAFE + - LIST_FOR_EACH_ENTRY_SAFE_REV + - list_for_each_entry + - list_for_each_entry_safe + - list_for_each_entry_rev + - list_for_each_entry_rev_safe + - list_for_each_entry_from + - list_for_each_entry_from_rev + - foreach_list_typed + - u_foreach_bit + - util_dynarray_foreach + - rb_tree_foreach + - rb_tree_foreach_safe + - nir_foreach_variable + - nir_foreach_variable_safe + - nir_foreach_uniform_variable + - nir_foreach_uniform_variable_safe + - nir_foreach_register + - nir_foreach_register_safe + - nir_foreach_use + - nir_foreach_use_safe + - nir_foreach_if_use + - nir_foreach_if_use_safe + - nir_foreach_def + - nir_foreach_def_safe + - nir_foreach_phi_src + - nir_foreach_phi_src_safe + - nir_foreach_parallel_copy_entry + - nir_foreach_instr + - nir_foreach_instr_reverse + - nir_foreach_instr_safe + - nir_foreach_instr_reverse_safe + - nir_foreach_instr_from_safe + - nir_foreach_function + - nir_foreach_block + - nir_foreach_block_safe + - nir_foreach_block_reverse + - nir_foreach_block_reverse_safe + - nir_foreach_block_in_cf_node + - nir_foreach_shader_in_variable + - nir_foreach_shader_out_variable_safe + - nir_foreach_variable_in_list + - nir_foreach_variable_with_modes_safe + - nir_foreach_variable_with_modes + - nir_foreach_shader_out_variable + - foreach_batch + - hash_table_foreach + - set_foreach + - pan_pack + - pan_section_pack + - bi_foreach_block + - bi_foreach_block_from + - bi_foreach_block_from_rev + - bi_foreach_block_rev + - bi_foreach_clause_in_block + - bi_foreach_clause_in_block_from + - bi_foreach_clause_in_block_from_rev + - bi_foreach_clause_in_block_rev + - bi_foreach_clause_in_block_safe + - bi_foreach_dest + - bi_foreach_instr_and_src_in_tuple + - bi_foreach_instr_global + - bi_foreach_instr_global_rev + - bi_foreach_instr_global_rev_safe + - bi_foreach_instr_global_safe + - bi_foreach_instr_in_block + - bi_foreach_instr_in_block_from + - bi_foreach_instr_in_block_from_rev + - bi_foreach_instr_in_block_rev + - bi_foreach_instr_in_block_safe + - bi_foreach_instr_in_block_safe_rev + - bi_foreach_instr_in_clause + - bi_foreach_instr_in_clause_rev + - bi_foreach_instr_in_tuple + - bi_foreach_predecessor + - bi_foreach_src + - bi_foreach_ssa_src + - bi_foreach_successor + - mir_foreach_block + - mir_foreach_block_from + - mir_foreach_bundle_in_block + - mir_foreach_bundle_in_block_rev + - mir_foreach_instr_global + - mir_foreach_instr_global_safe + - mir_foreach_instr_in_block + - mir_foreach_instr_in_block_from + - mir_foreach_instr_in_block_from_rev + - mir_foreach_instr_in_block_rev + - mir_foreach_instr_in_block_safe + - mir_foreach_instr_in_block_safe_rev + - mir_foreach_instr_in_block_scheduled_rev + - mir_foreach_predecessor + - mir_foreach_src + - nodearray_dense_foreach + - nodearray_dense_foreach_64 + - nodearray_sparse_foreach + - pan_foreach_instr_in_block_rev + - pan_foreach_predecessor + - pan_foreach_successor + +IncludeBlocks: Preserve +IncludeCategories: + - Regex: '<[[:alnum:].]+>' + Priority: 1 + - Regex: '.*\/.*' + Priority: 2 + - Regex: '.*' + Priority: 3 +IndentWidth: 3 +PenaltyBreakBeforeFirstCallParameter: 1 +PenaltyExcessCharacter: 100 +SpaceAfterCStyleCast: false +SpaceBeforeCpp11BracedList: false +SpaceBeforeParens: ControlStatementsExceptControlMacros +SpaceBeforeCtorInitializerColon: false +SpacesInContainerLiterals: false +