
AlignAfterOpenBracket: true
AlignConsecutiveMacros: true

AllowAllArgumentsOnNextLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: false

AlwaysBreakAfterReturnType: TopLevelDefinitions

BraceWrapping:
  AfterControlStatement: false
  AfterEnum: false
  AfterFunction: true
  AfterStruct: false
  BeforeElse: false
  SplitEmptyFunction: true

BinPackArguments: true
BinPackParameters: true

BreakBeforeBraces: Custom

ColumnLimit: 0
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyExcessCharacter: 100

ContinuationIndentWidth: 3
IndentWidth: 3
UseTab: Never

Cpp11BracedListStyle: true

SpaceAfterCStyleCast: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: false
SpacesInContainerLiterals: false

PointerAlignment: Right

IncludeBlocks: Preserve
IncludeCategories:
  - Regex:           '<[[:alnum:].]+>'
    Priority:        1
  - Regex:           '.*\/.*'
    Priority:        2
  - Regex:           '.*'
    Priority:        3

ForEachMacros:
# util
  - u_foreach_bit
  - u_foreach_bit64

  - BITSET_FOREACH_SET
  - BITSET_FOREACH_RANGE

  - hash_table_foreach
  - hash_table_foreach_remove
  - hash_table_u64_foreach

  - rb_tree_foreach
  - rb_tree_foreach_rev
  - rb_tree_foreach_rev_safe
  - rb_tree_foreach_safe
  - uinterval_tree_foreach

  - set_foreach
  - set_foreach_remove

  - util_dynarray_foreach
  - util_dynarray_foreach_reverse

  - util_idalloc_foreach

  - LIST_FOR_EACH_ENTRY
  - LIST_FOR_EACH_ENTRY_FROM
  - LIST_FOR_EACH_ENTRY_FROM_REV
  - LIST_FOR_EACH_ENTRY_SAFE
  - LIST_FOR_EACH_ENTRY_SAFE_REV
  - list_for_each_entry
  - list_for_each_entry_from
  - list_for_each_entry_from_rev
  - list_for_each_entry_from_safe
  - list_for_each_entry_rev
  - list_for_each_entry_rev_safe
  - list_for_each_entry_safe
  - list_pair_for_each_entry

  - foreach_in_list
  - foreach_in_list_reverse
  - foreach_in_list_reverse_safe
  - foreach_in_list_safe
  - foreach_in_list_use_after
  - foreach_list_typed
  - foreach_list_typed_from
  - foreach_list_typed_reverse
  - foreach_list_typed_reverse_safe
  - foreach_list_typed_safe
  - foreach_two_lists

# nir
  - nir_foreach_function_temp_variable
  - nir_foreach_function_temp_variable_safe
  - nir_foreach_image_variable
  - nir_foreach_image_variable_safe
  - nir_foreach_shader_in_variable
  - nir_foreach_shader_in_variable_safe
  - nir_foreach_shader_out_variable
  - nir_foreach_shader_out_variable_safe
  - nir_foreach_uniform_variable
  - nir_foreach_uniform_variable_safe
  - nir_foreach_variable
  - nir_foreach_variable_in_list
  - nir_foreach_variable_in_list_safe
  - nir_foreach_variable_in_shader
  - nir_foreach_variable_in_shader_safe
  - nir_foreach_variable_safe
  - nir_foreach_variable_with_modes
  - nir_foreach_variable_with_modes_safe

  - nir_foreach_reg_decl
  - nir_foreach_reg_decl_safe
  - nir_foreach_reg_load
  - nir_foreach_reg_load_safe
  - nir_foreach_reg_store
  - nir_foreach_reg_store_safe

  - nir_foreach_if_use
  - nir_foreach_if_use_safe
  - nir_foreach_use
  - nir_foreach_use_including_if
  - nir_foreach_use_including_if_safe
  - nir_foreach_use_safe

  - nir_foreach_phi_src
  - nir_foreach_phi_src_safe

  - nir_foreach_parallel_copy_entry

  - nir_foreach_instr
  - nir_foreach_instr_in_worklist
  - nir_foreach_instr_reverse
  - nir_foreach_instr_reverse_safe
  - nir_foreach_instr_safe

  - nir_foreach_phi
  - nir_foreach_phi_safe

  - nir_foreach_function
  - nir_foreach_function_safe
  - nir_foreach_function_with_impl

  - nir_foreach_function_impl

  - nir_foreach_block_unstructured
  - nir_foreach_block_unstructured_safe

  - nir_foreach_block
  - nir_foreach_block_in_cf_node
  - nir_foreach_block_in_cf_node_reverse
  - nir_foreach_block_reverse
  - nir_foreach_block_reverse_safe
  - nir_foreach_block_safe

# egl
  - egl_relax

# wayland
  - wl_list_for_each
  - wl_list_for_each_safe
  - wl_list_for_each_reverse
  - wl_list_for_each_reverse_safe
  - wl_array_for_each

# vulkan
  - vk_foreach_queue
  - vk_foreach_queue_safe

  - vk_foreach_struct
  - vk_foreach_struct_const

  - vk_foreach_multi_draw
  - vk_foreach_multi_draw_indexed

# asahi
  - foreach_active
  - foreach_submitted
  - AGX_BATCH_FOREACH_BO_HANDLE
  - agx_pack
  - agx_push
  - agx_usc_pack
  - agx_ppp_push
  - agx_foreach_block
  - agx_foreach_block_from
  - agx_foreach_block_from_rev
  - agx_foreach_block_rev
  - agx_foreach_dest
  - agx_foreach_dest_rev
  - agx_foreach_instr_global
  - agx_foreach_instr_global_rev
  - agx_foreach_instr_global_safe
  - agx_foreach_instr_global_safe_rev
  - agx_foreach_instr_in_block
  - agx_foreach_instr_in_block_from
  - agx_foreach_instr_in_block_from_rev
  - agx_foreach_instr_in_block_rev
  - agx_foreach_instr_in_block_safe
  - agx_foreach_instr_in_block_safe_rev
  - agx_foreach_non_phi_in_block_rev
  - agx_foreach_phi_in_block
  - agx_foreach_phi_in_block_safe
  - agx_foreach_predecessor
  - agx_foreach_src
  - agx_foreach_src_rev
  - agx_foreach_ssa_dest
  - agx_foreach_ssa_dest_rev
  - agx_foreach_ssa_src
  - agx_foreach_ssa_src_rev
  - agx_foreach_successor
  - foreach_next_use

# radv
  - PHASE

# freedreno
  - ir2_foreach_instr
  - ir2_foreach_live_reg
  - ir2_foreach_avail
  - ir2_foreach_src
  - foreach_two_lists
  - foreach_sched_node
  - foreach_src
  - foreach_src_n
  - foreach_src_if
  - foreach_dst
  - foreach_dst_n
  - foreach_dst_if
  - ra_foreach_dst
  - ra_foreach_src
  - ra_foreach_src_rev
  - foreach_ssa_use
  - foreach_ssa_srcp_n
  - foreach_ssa_srcp
  - foreach_ssa_src_n
  - foreach_ssa_src
  - foreach_input_n
  - foreach_input
  - foreach_output_n
  - foreach_output
  - foreach_instr
  - foreach_instr_rev
  - foreach_instr_safe
  - foreach_instr_from_safe
  - foreach_block
  - foreach_block_safe
  - foreach_block_rev
  - foreach_array
  - foreach_array_safe
  - foreach_name_n
  - foreach_name
  - foreach_def
  - foreach_use
  - foreach_interval
  - foreach_interval_safe
  - foreach_interval_rev
  - foreach_interval_rev_safe
  - foreach_batch
  - foreach_line_in_section
  - perf_time
  - perf_time_ctx
  - foreach_submit
  - foreach_submit_safe

# panfrost
  - foreach_batch
  - 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
  - cs_emit
  - 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

# Disable clang formatting by default. Drivers that use clang-format
# inherit from this .clang-format file and re-enable formatting:
#
# DisableFormat: false
#
DisableFormat: true
