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