aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2015-11-19 13:32:09 +0100
committerMartin Liska <marxin@gcc.gnu.org>2015-11-19 12:32:09 +0000
commitdaa53f38eeff5a6de8c6e345f6e0aa4385b514ec (patch)
tree9bd3a39bf02de03eef899fbbd13c59cea15633df
parent05f44cf5de90b7adf109cda8ad30f6fa0268b9ca (diff)
downloadgcc-daa53f38eeff5a6de8c6e345f6e0aa4385b514ec.zip
gcc-daa53f38eeff5a6de8c6e345f6e0aa4385b514ec.tar.gz
gcc-daa53f38eeff5a6de8c6e345f6e0aa4385b514ec.tar.bz2
Add clang-format config to contrib folder
* .gitignore: Add .clang-format to ignored files. * Makefile.in: Add clang-format. * Makefile.tpl: Likewise. * clang-format: New file. From-SVN: r230601
-rw-r--r--.gitignore2
-rw-r--r--ChangeLog6
-rw-r--r--Makefile.in9
-rw-r--r--Makefile.tpl9
-rw-r--r--contrib/ChangeLog4
-rw-r--r--contrib/clang-format55
6 files changed, 85 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index ab97ac6..c9a6158 100644
--- a/.gitignore
+++ b/.gitignore
@@ -35,6 +35,8 @@ TAGS.sub
.local.vimrc
.lvimrc
+.clang-format
+
.gdbinit
.gdb_history
diff --git a/ChangeLog b/ChangeLog
index f665a3d..a74532a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-11-19 Martin Liska <mliska@suse.cz>
+
+ * .gitignore: Add .clang-format to ignored files.
+ * Makefile.in: Add clang-format.
+ * Makefile.tpl: Likewise.
+
2015-11-13 Tsvetkova Alexandra <aleksandra.tsvetkova@intel.com>
* configure.ac: Enable libmpx by default.
diff --git a/Makefile.in b/Makefile.in
index bc2bae6..75caafd 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -2461,6 +2461,15 @@ vimrc: $(srcdir)/.local.vimrc $(srcdir)/.lvimrc
.PHONY: vimrc
+# clang-format config
+
+$(srcdir)/.clang-format:
+ $(LN_S) contrib/clang-format $@
+
+clang-format: $(srcdir)/.clang-format
+
+.PHONY: clang-format
+
# Installation targets.
.PHONY: install uninstall
diff --git a/Makefile.tpl b/Makefile.tpl
index 660e1e4..beabadc 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -889,6 +889,15 @@ vimrc: $(srcdir)/.local.vimrc $(srcdir)/.lvimrc
.PHONY: vimrc
+# clang-format config
+
+$(srcdir)/.clang-format:
+ $(LN_S) contrib/clang-format $@
+
+clang-format: $(srcdir)/.clang-format
+
+.PHONY: clang-format
+
# Installation targets.
.PHONY: install uninstall
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index 543e952..c35a83f 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,7 @@
+2015-11-19 Martin Liska <mliska@suse.cz>
+
+ * clang-format: New file.
+
2015-11-11 Andrew MacLeod <amacleod@redhat.com>
* header-tools: New. Directory containing a set of tools for
diff --git a/contrib/clang-format b/contrib/clang-format
new file mode 100644
index 0000000..8a6fd4b
--- /dev/null
+++ b/contrib/clang-format
@@ -0,0 +1,55 @@
+# Copyright (C) 2015 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# clang-format 3.8+ (Mon Nov 16) is required
+#
+# To utilize the tool to lines just touched by a patch, use
+# clang-format-diff.py script, which can be downloaded here:
+# https://llvm.org/svn/llvm-project/cfe/trunk/tools/clang-format/clang-format-diff.py
+
+---
+Language: Cpp
+AccessModifierOffset: -2
+AlwaysBreakAfterDefinitionReturnType: All
+BinPackArguments: true
+BinPackParameters: true
+BraceWrapping:
+ AfterClass: true
+ AfterControlStatement: true
+ AfterEnum: true
+ AfterFunction: true
+ AfterNamespace: false
+ AfterObjCDeclaration: true
+ AfterStruct: true
+ AfterUnion: true
+ BeforeCatch: true
+ BeforeElse: true
+ IndentBraces: true
+BreakBeforeBinaryOperators: All
+BreakBeforeBraces: Custom
+BreakBeforeTernaryOperators: true
+ColumnLimit: 80
+ConstructorInitializerIndentWidth: 2
+ContinuationIndentWidth: 2
+ForEachMacros: ['_FOR_EACH','_FOR_EACH_1','FOR_EACH_AGGR_INIT_EXPR_ARG','FOR_EACH_ALIAS','FOR_EACH_ALLOCNO','FOR_EACH_ALLOCNO_OBJECT','FOR_EACH_ARTIFICIAL_DEF','FOR_EACH_ARTIFICIAL_USE','FOR_EACH_BB_FN','FOR_EACH_BB_REVERSE_FN','FOR_EACH_BIT_IN_MINMAX_SET','FOR_EACH_CALL_EXPR_ARG','FOR_EACH_CLONE','FOR_EACH_CONST_CALL_EXPR_ARG','FOR_EACH_CONSTRUCTOR_ELT','FOR_EACH_CONSTRUCTOR_VALUE','FOR_EACH_COPY','FOR_EACH_DEF','FOR_EACH_DEFINED_FUNCTION','FOR_EACH_DEFINED_SYMBOL','FOR_EACH_DEFINED_VARIABLE','FOR_EACH_DEP','FOR_EACH_EDGE','FOR_EACH_EXPR','FOR_EACH_EXPR_1','FOR_EACH_FUNCTION','FOR_EACH_FUNCTION_WITH_GIMPLE_BODY','FOR_EACH_HASH_TABLE_ELEMENT','FOR_EACH_IMM_USE_FAST','FOR_EACH_IMM_USE_ON_STMT','FOR_EACH_IMM_USE_STMT','FOR_EACH_INSN','FOR_EACH_INSN_1','FOR_EACH_INSN_DEF','FOR_EACH_INSN_EQ_USE','FOR_EACH_INSN_INFO_DEF','FOR_EACH_INSN_INFO_EQ_USE','FOR_EACH_INSN_INFO_MW','FOR_EACH_INSN_INFO_USE','FOR_EACH_INSN_USE','FOR_EACH_LOCAL_DECL','FOR_EACH_LOOP','FOR_EACH_LOOP_FN','FOR_EACH_OBJECT','FOR_EACH_OBJECT_CONFLICT','FOR_EACH_PHI_ARG','FOR_EACH_PHI_OR_STMT_DEF','FOR_EACH_PHI_OR_STMT_USE','FOR_EACH_PREF','FOR_EACH_SCALAR','FOR_EACH_SSA_DEF_OPERAND','FOR_EACH_SSA_TREE_OPERAND','FOR_EACH_SSA_USE_OPERAND','FOR_EACH_STATIC_INITIALIZER','FOR_EACH_SUBRTX','FOR_EACH_SUBRTX_PTR','FOR_EACH_SUBRTX_VAR','FOR_EACH_SUCC','FOR_EACH_SUCC_1','FOR_EACH_SYMBOL','FOR_EACH_VARIABLE','FOR_EACH_VEC_ELT','FOR_EACH_VEC_ELT_FROM','FOR_EACH_VEC_ELT_REVERSE','FOR_EACH_VEC_SAFE_ELT','FOR_EACH_VEC_SAFE_ELT_REVERSE','_FOR_EACH_X','_FOR_EACH_X_1','FOREACH_FUNCTION_ARGS','FOREACH_FUNCTION_ARGS_PTR']
+IndentCaseLabels: false
+NamespaceIndentation: None
+PenaltyBreakBeforeFirstCallParameter: 100
+PointerAlignment: Right
+SortIncludes: false
+SpaceAfterCStyleCast: true
+SpaceBeforeParens: Always
+SpacesBeforeTrailingComments: 1
+UseTab: Always