clang-format 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. # Copyright (C) 2015 Free Software Foundation, Inc.
  2. #
  3. # This program is free software; you can redistribute it and/or modify
  4. # it under the terms of the GNU General Public License as published by
  5. # the Free Software Foundation; either version 3 of the License, or
  6. # (at your option) any later version.
  7. #
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. # clang-format 7.0.1 is required
  16. #
  17. # To utilize the tool to lines just touched by a patch, use
  18. # clang-format-diff script that is usually also packaged with clang-format.
  19. #
  20. # Example of usage:
  21. # git diff -U0 --no-color | clang-format-diff -p1
  22. # (here the tool will generate a patch)
  23. # git diff -U0 --no-color | clang-format-diff -p1 -i
  24. # (modifications are applied)
  25. ---
  26. Language: Cpp
  27. AccessModifierOffset: -2
  28. AlwaysBreakAfterReturnType: TopLevel
  29. BinPackArguments: true
  30. BinPackParameters: true
  31. BraceWrapping:
  32. AfterClass: true
  33. AfterControlStatement: true
  34. AfterEnum: true
  35. AfterFunction: true
  36. AfterNamespace: false
  37. AfterObjCDeclaration: true
  38. AfterStruct: true
  39. AfterUnion: true
  40. BeforeCatch: true
  41. BeforeElse: true
  42. IndentBraces: true
  43. SplitEmptyFunction: false
  44. BreakBeforeBinaryOperators: All
  45. BreakBeforeBraces: Custom
  46. BreakBeforeTernaryOperators: true
  47. ColumnLimit: 80
  48. ConstructorInitializerIndentWidth: 2
  49. ContinuationIndentWidth: 2
  50. ForEachMacros: [
  51. 'FOR_ALL_BB_FN',
  52. 'FOR_ALL_EH_REGION',
  53. 'FOR_ALL_EH_REGION_AT',
  54. 'FOR_ALL_EH_REGION_FN',
  55. 'FOR_ALL_INHERITED_FIELDS',
  56. 'FOR_ALL_PREDICATES',
  57. 'FOR_BB_BETWEEN',
  58. 'FOR_BB_INSNS',
  59. 'FOR_BB_INSNS_REVERSE',
  60. 'FOR_BB_INSNS_REVERSE_SAFE',
  61. 'FOR_BB_INSNS_SAFE',
  62. 'FOR_BODY',
  63. 'FOR_COND',
  64. 'FOR_EACH_AGGR_INIT_EXPR_ARG',
  65. 'FOR_EACH_ALIAS',
  66. 'FOR_EACH_ALLOCNO',
  67. 'FOR_EACH_ALLOCNO_OBJECT',
  68. 'FOR_EACH_ARTIFICIAL_DEF',
  69. 'FOR_EACH_ARTIFICIAL_USE',
  70. 'FOR_EACH_BB_FN',
  71. 'FOR_EACH_BB_REVERSE_FN',
  72. 'FOR_EACH_BIT_IN_MINMAX_SET',
  73. 'FOR_EACH_CALL_EXPR_ARG',
  74. 'FOR_EACH_CLONE',
  75. 'FOR_EACH_CONST_CALL_EXPR_ARG',
  76. 'FOR_EACH_CONSTRUCTOR_ELT',
  77. 'FOR_EACH_CONSTRUCTOR_VALUE',
  78. 'FOR_EACH_COPY',
  79. 'FOR_EACH_DEF',
  80. 'FOR_EACH_DEFINED_FUNCTION',
  81. 'FOR_EACH_DEFINED_SYMBOL',
  82. 'FOR_EACH_DEFINED_VARIABLE',
  83. 'FOR_EACH_DEP',
  84. 'FOR_EACH_EDGE',
  85. 'FOR_EACH_EXPR',
  86. 'FOR_EACH_EXPR_1',
  87. 'FOR_EACH_FUNCTION',
  88. 'FOREACH_FUNCTION_ARGS',
  89. 'FOREACH_FUNCTION_ARGS_PTR',
  90. 'FOR_EACH_FUNCTION_WITH_GIMPLE_BODY',
  91. 'FOR_EACH_HASH_TABLE_ELEMENT',
  92. 'FOR_EACH_IMM_USE_FAST',
  93. 'FOR_EACH_IMM_USE_ON_STMT',
  94. 'FOR_EACH_IMM_USE_STMT',
  95. 'FOR_EACH_INSN',
  96. 'FOR_EACH_INSN_1',
  97. 'FOR_EACH_INSN_DEF',
  98. 'FOR_EACH_INSN_EQ_USE',
  99. 'FOR_EACH_INSN_INFO_DEF',
  100. 'FOR_EACH_INSN_INFO_EQ_USE',
  101. 'FOR_EACH_INSN_INFO_MW',
  102. 'FOR_EACH_INSN_INFO_USE',
  103. 'FOR_EACH_INSN_USE',
  104. 'FOR_EACH_LOCAL_DECL',
  105. 'FOR_EACH_LOOP',
  106. 'FOR_EACH_LOOP_FN',
  107. 'FOR_EACH_OBJECT',
  108. 'FOR_EACH_OBJECT_CONFLICT',
  109. 'FOR_EACH_PHI_ARG',
  110. 'FOR_EACH_PHI_OR_STMT_DEF',
  111. 'FOR_EACH_PHI_OR_STMT_USE',
  112. 'FOR_EACH_PREF',
  113. 'FOR_EACH_SCALAR',
  114. 'FOR_EACH_SSA_DEF_OPERAND',
  115. 'FOR_EACH_SSA_TREE_OPERAND',
  116. 'FOR_EACH_SSA_USE_OPERAND',
  117. 'FOR_EACH_STATIC_INITIALIZER',
  118. 'FOR_EACH_SUBRTX',
  119. 'FOR_EACH_SUBRTX_PTR',
  120. 'FOR_EACH_SUBRTX_VAR',
  121. 'FOR_EACH_SUCC',
  122. 'FOR_EACH_SUCC_1',
  123. 'FOR_EACH_SYMBOL',
  124. 'FOR_EACH_VARIABLE',
  125. 'FOR_EACH_VEC_ELT',
  126. 'FOR_EACH_VEC_ELT_FROM',
  127. 'FOR_EACH_VEC_ELT_REVERSE',
  128. 'FOR_EACH_VEC_SAFE_ELT',
  129. 'FOR_EACH_VEC_SAFE_ELT_REVERSE',
  130. 'FOR_EXPR',
  131. 'FOR_INIT_STMT',
  132. 'FOR_SCOPE'
  133. ]
  134. IndentCaseLabels: false
  135. NamespaceIndentation: None
  136. PenaltyBreakBeforeFirstCallParameter: 100
  137. PointerAlignment: Right
  138. SortIncludes: false
  139. SpaceAfterCStyleCast: true
  140. SpaceBeforeParens: Always
  141. SpacesBeforeTrailingComments: 1
  142. UseTab: Always
  143. AlignEscapedNewlines: Right
  144. AlignTrailingComments: true
  145. AllowShortFunctionsOnASingleLine: All
  146. AlwaysBreakTemplateDeclarations: MultiLine
  147. KeepEmptyLinesAtTheStartOfBlocks: false
  148. Standard: Auto