• 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  - u_foreach_bit
88  - u_foreach_bit64
89
90IncludeBlocks: Preserve
91IncludeCategories:
92  - Regex:           '<[[:alnum:].]+>'
93    Priority:        1
94  - Regex:           '.*\/.*'
95    Priority:        2
96  - Regex:           '.*'
97    Priority:        3
98IndentWidth: 3
99PenaltyBreakBeforeFirstCallParameter: 1
100PenaltyExcessCharacter: 100
101SpaceAfterCStyleCast: false
102SpaceBeforeCpp11BracedList: false
103SpaceBeforeCtorInitializerColon: false
104SpacesInContainerLiterals: false
105
106
107# ACO clang-format rules:
108Language: Cpp
109Standard: c++14
110
111# Force pointers to the type for C++
112DerivePointerAlignment: false
113PointerAlignment: Left
114
115# Same effect as IndentAccessModifiers: False
116AccessModifierOffset: -3
117
118# Compact some cumbersome C++ code
119SpaceBeforeCtorInitializerColon: True
120AllowShortCaseLabelsOnASingleLine: True
121AllowShortFunctionsOnASingleLine: InlineOnly
122AllowShortBlocksOnASingleLine: Empty
123AllowShortLambdasOnASingleLine: All
124
125# Wrap before LambdaBody and disable SplitEmptyFunction
126BraceWrapping:
127  AfterControlStatement: false
128  AfterEnum: false
129  AfterFunction: true
130  AfterStruct: false
131  BeforeElse: false
132  SplitEmptyFunction: false
133  SplitEmptyRecord: false
134  BeforeLambdaBody: true
135
136# Regroup #include blocks
137IncludeBlocks: Regroup
138IncludeCategories:
139  - Regex:           '"aco.*'
140    Priority:        1
141  - Regex:           '"(common|llvm|vulkan)\/.*'
142    Priority:        2
143  - Regex:           '"(nir|util\/).*'
144    Priority:        3
145  - Regex:           '.*\/.*'
146    Priority:        4
147  - Regex:           '.*'
148    Priority:        5
149
150