• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2# TODO: Inherit Style from RADV when Clang 13 is default.
3# BasedOnStyle: InheritParentConfig
4
5# Copied from /src/amd/.clang-format
6# ACO specific rules can be found below
7AlignAfterOpenBracket: true
8AlignConsecutiveMacros: true
9AllowAllArgumentsOnNextLine: false
10AllowShortCaseLabelsOnASingleLine: false
11AllowShortFunctionsOnASingleLine: false
12AlwaysBreakAfterReturnType: TopLevelDefinitions
13BasedOnStyle: LLVM
14BraceWrapping:
15  AfterControlStatement: false
16  AfterEnum: false
17  AfterFunction: true
18  AfterStruct: false
19  BeforeElse: false
20  SplitEmptyFunction: true
21BinPackArguments: true
22BinPackParameters: true
23BreakBeforeBraces: Custom
24ColumnLimit: 100
25ContinuationIndentWidth: 3
26Cpp11BracedListStyle: false
27Cpp11BracedListStyle: true
28ForEachMacros:
29  - LIST_FOR_EACH_ENTRY
30  - LIST_FOR_EACH_ENTRY_SAFE
31  - foreach_list_typed
32  - util_dynarray_foreach
33  - nir_foreach_variable
34  - nir_foreach_variable_safe
35  - nir_foreach_register
36  - nir_foreach_register_safe
37  - nir_foreach_use
38  - nir_foreach_use_safe
39  - nir_foreach_if_use
40  - nir_foreach_if_use_safe
41  - nir_foreach_def
42  - nir_foreach_def_safe
43  - nir_foreach_phi_src
44  - nir_foreach_phi_src_safe
45  - nir_foreach_parallel_copy_entry
46  - nir_foreach_instr
47  - nir_foreach_instr_reverse
48  - nir_foreach_instr_safe
49  - nir_foreach_instr_reverse_safe
50  - nir_foreach_function
51  - nir_foreach_block
52  - nir_foreach_block_safe
53  - nir_foreach_block_reverse
54  - nir_foreach_block_reverse_safe
55  - nir_foreach_block_in_cf_node
56  - nir_foreach_shader_in_variable
57  - nir_foreach_shader_out_variable_safe
58  - nir_foreach_variable_in_list
59  - nir_foreach_src
60  - foreach_two_lists
61  - foreach_bit
62  - foreach_sched_node
63  - foreach_src
64  - foreach_src_n
65  - foreach_ssa_use
66  - foreach_ssa_srcp_n
67  - foreach_ssa_srcp
68  - foreach_ssa_src_n
69  - foreach_ssa_src
70  - foreach_input_n
71  - foreach_input
72  - foreach_output_n
73  - foreach_output
74  - foreach_instr
75  - foreach_instr_rev
76  - foreach_instr_safe
77  - foreach_block
78  - foreach_block_safe
79  - foreach_block_rev
80  - foreach_array
81  - foreach_array_safe
82  - foreach_name_n
83  - foreach_name
84  - foreach_def
85  - foreach_use
86  - set_foreach
87
88IncludeBlocks: Preserve
89IncludeCategories:
90  - Regex:           '<[[:alnum:].]+>'
91    Priority:        1
92  - Regex:           '.*\/.*'
93    Priority:        2
94  - Regex:           '.*'
95    Priority:        3
96IndentWidth: 3
97PenaltyBreakBeforeFirstCallParameter: 1
98PenaltyExcessCharacter: 100
99SpaceAfterCStyleCast: false
100SpaceBeforeCpp11BracedList: false
101SpaceBeforeCtorInitializerColon: false
102SpacesInContainerLiterals: false
103
104
105# ACO clang-format rules:
106Language: Cpp
107Standard: c++14
108
109# Force pointers to the type for C++
110DerivePointerAlignment: false
111PointerAlignment: Left
112
113# Same effect as IndentAccessModifiers: False
114AccessModifierOffset: -3
115
116# Compact some cumbersome C++ code
117SpaceBeforeCtorInitializerColon: True
118AllowShortCaseLabelsOnASingleLine: True
119AllowShortFunctionsOnASingleLine: InlineOnly
120AllowShortBlocksOnASingleLine: Empty
121AllowShortLambdasOnASingleLine: All
122
123# Wrap before LambdaBody and disable SplitEmptyFunction
124BraceWrapping:
125  AfterControlStatement: false
126  AfterEnum: false
127  AfterFunction: true
128  AfterStruct: false
129  BeforeElse: false
130  SplitEmptyFunction: false
131  SplitEmptyRecord: false
132  BeforeLambdaBody: true
133
134# Regroup #include blocks
135IncludeBlocks: Regroup
136IncludeCategories:
137  - Regex:           '"aco.*'
138    Priority:        1
139  - Regex:           '"(common|llvm|vulkan)\/.*'
140    Priority:        2
141  - Regex:           '"(nir|util\/).*'
142    Priority:        3
143  - Regex:           '.*\/.*'
144    Priority:        4
145  - Regex:           '.*'
146    Priority:        5
147
148