diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-09-18 18:28:45 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-09-18 18:28:45 +0000 |
commit | 58a73f6da5d0ed7dc1b04cbfb90c0205a3c50e3f (patch) | |
tree | 41687c822ea825dcc079e7f471d9ec806d311374 /contrib | |
parent | 281de4253d972d89f21b2bc3ef4050f88e3fcf3c (diff) | |
parent | ba7c8cb5715a162ac41ca5241628e7e02ecd217f (diff) | |
download | gcc-58a73f6da5d0ed7dc1b04cbfb90c0205a3c50e3f.zip gcc-58a73f6da5d0ed7dc1b04cbfb90c0205a3c50e3f.tar.gz gcc-58a73f6da5d0ed7dc1b04cbfb90c0205a3c50e3f.tar.bz2 |
Merge from trunk revision 275890.
From-SVN: r275900
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/ChangeLog | 39 | ||||
-rw-r--r-- | contrib/clang-format | 20 | ||||
-rw-r--r-- | contrib/compare-all-tests | 2 | ||||
-rw-r--r-- | contrib/config-list.mk | 5 | ||||
-rw-r--r-- | contrib/header-tools/ChangeLog | 5 | ||||
-rw-r--r-- | contrib/header-tools/README | 2 | ||||
-rwxr-xr-x | contrib/header-tools/reduce-headers | 3 | ||||
-rwxr-xr-x | contrib/mklog | 98 | ||||
-rw-r--r-- | contrib/vimrc | 12 |
9 files changed, 119 insertions, 67 deletions
diff --git a/contrib/ChangeLog b/contrib/ChangeLog index fd7df43..5f62e8b 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,42 @@ +2019-09-18 Martin Liska <mliska@suse.cz> + + * clang-format: Tweak configuration based on new + options offered. + +2019-09-09 Jose E. Marchesi <jemarch@gnu.org> + + * config-list.mk (LIST): Disable go in bpf-*-* targets. + +2019-09-04 Martin Liska <mliska@suse.cz> + + * mklog: Do not print changed functions for + testsuite files. + +2019-09-04 Martin Liska <mliska@suse.cz> + + * mklog: Parse PR references from newly added + test files. + +2019-09-04 Martin Liska <mliska@suse.cz> + + * mklog: Use argparse instead of getopt. + +2019-09-03 Ulrich Weigand <uweigand@de.ibm.com> + + * compare-all-tests (all_targets): Remove references to spu. + * config-list.mk (LIST): Likewise. + +2019-09-02 Alexander Monakov <amonakov@ispras.ru> + + * vim-gcc-dev/syntax/gcc-match.vim: Do not override 'tabstop' here. + * vimrc: Set preferred values for 'tabstop', 'softtabstop', + 'shiftwidth', 'noexpandtab', 'textwidth', 'formatoptions' for all + files, not just C-like files. + +2019-09-02 Martin Liska <mliska@suse.cz> + + * vim-gcc-dev/syntax/gcc-match.vim: Set tabstop=8. + 2019-08-13 Uros Bizjak <ubizjak@gmail.com> * test_summary: Do not escape "=". diff --git a/contrib/clang-format b/contrib/clang-format index d734001..7a4e96f 100644 --- a/contrib/clang-format +++ b/contrib/clang-format @@ -13,16 +13,21 @@ # 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 +# clang-format 7.0.1 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 +# clang-format-diff script that is usually also packaged with clang-format. +# +# Example of usage: +# git diff -U0 --no-color | clang-format-diff -p1 +# (here the tool will generate a patch) +# git diff -U0 --no-color | clang-format-diff -p1 -i +# (modifications are applied) --- Language: Cpp AccessModifierOffset: -2 -AlwaysBreakAfterDefinitionReturnType: All +AlwaysBreakAfterReturnType: TopLevel BinPackArguments: true BinPackParameters: true BraceWrapping: @@ -37,6 +42,7 @@ BraceWrapping: BeforeCatch: true BeforeElse: true IndentBraces: true + SplitEmptyFunction: false BreakBeforeBinaryOperators: All BreakBeforeBraces: Custom BreakBeforeTernaryOperators: true @@ -136,3 +142,9 @@ SpaceAfterCStyleCast: true SpaceBeforeParens: Always SpacesBeforeTrailingComments: 1 UseTab: Always +AlignEscapedNewlines: Right +AlignTrailingComments: true +AllowShortFunctionsOnASingleLine: All +AlwaysBreakTemplateDeclarations: MultiLine +KeepEmptyLinesAtTheStartOfBlocks: false +Standard: Cpp03 diff --git a/contrib/compare-all-tests b/contrib/compare-all-tests index 7851a1b..502cc64 100644 --- a/contrib/compare-all-tests +++ b/contrib/compare-all-tests @@ -34,7 +34,7 @@ s390_opts='-m31 -m31/-mzarch -m64' sh_opts='-m3 -m3e -m4 -m4a -m4al -m4/-mieee -m1 -m1/-mno-cbranchdi -m2a -m2a/-mieee -m2e -m2e/-mieee' sparc_opts='-mcpu=v8/-m32 -mcpu=v9/-m32 -m64' -all_targets='alpha arm avr bfin cris fr30 frv h8300 ia64 iq2000 m32c m32r m68k mcore mips mmix mn10300 pa pdp11 ppc sh sparc spu v850 vax xstormy16 xtensa' # e500 +all_targets='alpha arm avr bfin cris fr30 frv h8300 ia64 iq2000 m32c m32r m68k mcore mips mmix mn10300 pa pdp11 ppc sh sparc v850 vax xstormy16 xtensa' # e500 test_one_file () { diff --git a/contrib/config-list.mk b/contrib/config-list.mk index 69c826e..a5f5d7b 100644 --- a/contrib/config-list.mk +++ b/contrib/config-list.mk @@ -40,6 +40,7 @@ LIST = aarch64-elf aarch64-linux-gnu aarch64-rtems \ arm-linux-androideabi arm-uclinux_eabi arm-eabi arm-rtems \ arm-symbianelf avr-elf \ bfin-elf bfin-uclinux bfin-linux-uclibc bfin-rtems bfin-openbsd \ + bpf-unknown-none \ c6x-elf c6x-uclinux cr16-elf cris-elf cris-linux crisv32-elf crisv32-linux \ csky-elf csky-linux-gnu \ epiphany-elf epiphany-elfOPT-with-stack-offset=16 fido-elf \ @@ -90,7 +91,7 @@ LIST = aarch64-elf aarch64-linux-gnu aarch64-rtems \ sparc-leon3-linux-gnuOPT-enable-target=all sparc-netbsdelf \ sparc64-sun-solaris2.11OPT-with-gnu-ldOPT-with-gnu-asOPT-enable-threads=posix \ sparc-wrs-vxworks sparc64-elf sparc64-rtems sparc64-linux sparc64-freebsd6 \ - sparc64-netbsd sparc64-openbsd spu-elf \ + sparc64-netbsd sparc64-openbsd \ tilegx-linux-gnu tilegxbe-linux-gnu tilepro-linux-gnu \ v850e-elf v850-elf v850-rtems vax-linux-gnu \ vax-netbsdelf vax-openbsd visium-elf x86_64-apple-darwin \ @@ -123,7 +124,7 @@ $(LIST): make-log-dir TGT=`echo $@ | awk 'BEGIN { FS = "OPT" }; { print $$1 }'` && \ TGT=`$(GCC_SRC_DIR)/config.sub $$TGT` && \ case $$TGT in \ - *-*-darwin* | *-*-cygwin* | *-*-mingw* | *-*-aix*) \ + *-*-darwin* | *-*-cygwin* | *-*-mingw* | *-*-aix* | bpf-*-*) \ ADDITIONAL_LANGUAGES=""; \ ;; \ *) \ diff --git a/contrib/header-tools/ChangeLog b/contrib/header-tools/ChangeLog index 8977a00..6415473 100644 --- a/contrib/header-tools/ChangeLog +++ b/contrib/header-tools/ChangeLog @@ -1,3 +1,8 @@ +2019-09-03 Ulrich Weigand <uweigand@de.ibm.com> + + * README: Remove references to spu. + * reduce-headers: Likewise. + 2017-07-02 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> diff --git a/contrib/header-tools/README b/contrib/header-tools/README index 3b20e51..592af3a 100644 --- a/contrib/header-tools/README +++ b/contrib/header-tools/README @@ -203,7 +203,7 @@ reduce-headers these targets. They are also known to the tool. When building targets it will check those targets before the rest. This coverage can be achieved by building config-list.mk with : - LIST="aarch64-linux-gnu arm-netbsdelf c6x-elf epiphany-elf hppa2.0-hpux10.1 i686-mingw32crt i686-pc-msdosdjgpp mipsel-elf powerpc-eabisimaltivec rs6000-ibm-aix5.1.0 sh-superh-elf sparc64-elf spu-elf" + LIST="aarch64-linux-gnu arm-netbsdelf c6x-elf epiphany-elf hppa2.0-hpux10.1 i686-mingw32crt i686-pc-msdosdjgpp mipsel-elf powerpc-eabisimaltivec rs6000-ibm-aix5.1.0 sh-superh-elf sparc64-elf" -b specifies the native bootstrapped build root directory -t specifies a target build root directory that config-list.mk was run from diff --git a/contrib/header-tools/reduce-headers b/contrib/header-tools/reduce-headers index 26a7df9..8363736 100755 --- a/contrib/header-tools/reduce-headers +++ b/contrib/header-tools/reduce-headers @@ -32,8 +32,7 @@ target_priority = [ "powerpc-eabisimaltivec", "rs6000-ibm-aix5.1.0", "sh-superh-elf", - "sparc64-elf", - "spu-elf" + "sparc64-elf" ] diff --git a/contrib/mklog b/contrib/mklog index 15558cf..1a0e82d 100755 --- a/contrib/mklog +++ b/contrib/mklog @@ -28,11 +28,11 @@ # # Author: Yury Gribov <tetra2005@gmail.com> +import argparse import sys import re import os.path import os -import getopt import tempfile import time import shutil @@ -40,6 +40,8 @@ from subprocess import Popen, PIPE me = os.path.basename(sys.argv[0]) +pr_regex = re.compile('\+(\/(\/|\*)|[Cc*!])\s+(PR [a-z+-]+\/[0-9]+)') + def error(msg): sys.stderr.write("%s: error: %s\n" % (me, msg)) sys.exit(1) @@ -66,21 +68,6 @@ class RegexCache(object): cache = RegexCache() -def print_help_and_exit(): - print("""\ -Usage: %s [-i | --inline] [PATCH] -Generate ChangeLog template for PATCH. -PATCH must be generated using diff(1)'s -up or -cp options -(or their equivalent in Subversion/git). - -When PATCH is - or missing, read standard input. - -When -i is used, prepends ChangeLog to PATCH. -If PATCH is not stdin, modifies PATCH in-place, otherwise writes -to stdout. -""" % me) - sys.exit(1) - def run(cmd, die_on_error): """Simple wrapper for Popen.""" proc = Popen(cmd.split(' '), stderr = PIPE, stdout = PIPE) @@ -314,7 +301,7 @@ def parse_patch(contents): if l != r: break comps.append(l) - + if not comps: error("failed to extract common name for %s and %s" % (left, right)) @@ -353,41 +340,41 @@ def parse_patch(contents): return diffs -def main(): - name, email = read_user_info() - try: - opts, args = getopt.getopt(sys.argv[1:], 'hiv', ['help', 'verbose', 'inline']) - except getopt.GetoptError as err: - error(str(err)) - - inline = False - verbose = 0 - - for o, a in opts: - if o in ('-h', '--help'): - print_help_and_exit() - elif o in ('-i', '--inline'): - inline = True - elif o in ('-v', '--verbose'): - verbose += 1 +def get_pr_from_testcase(line): + r = pr_regex.search(line) + if r != None: + return r.group(3) else: - assert False, "unhandled option" + return None - if len(args) == 0: - args = ['-'] +def main(): + name, email = read_user_info() - if len(args) == 1 and args[0] == '-': - input = sys.stdin - elif len(args) == 1: - input = open(args[0]) - else: - error("too many arguments; for more details run with -h") + help_message = """\ +Generate ChangeLog template for PATCH. +PATCH must be generated using diff(1)'s -up or -cp options +(or their equivalent in Subversion/git). +""" + inline_message = """\ +Prepends ChangeLog to PATCH. +If PATCH is not stdin, modifies PATCH in-place, +otherwise writes to stdout.' +""" + + parser = argparse.ArgumentParser(description = help_message) + parser.add_argument('-v', '--verbose', action = 'store_true', help = 'Verbose messages') + parser.add_argument('-i', '--inline', action = 'store_true', help = inline_message) + parser.add_argument('input', nargs = '?', help = 'Patch file (or missing, read standard input)') + args = parser.parse_args() + if args.input == '-': + args.input = None + input = open(args.input) if args.input else sys.stdin contents = input.read() diffs = parse_patch(contents) - if verbose: + if args.verbose: print("Parse results:") for d in diffs: d.dump() @@ -395,6 +382,7 @@ def main(): # Generate template ChangeLog. logs = {} + prs = [] for d in diffs: log_name = d.clname @@ -410,13 +398,17 @@ def main(): if hunk0.is_file_addition(): if re.search(r'testsuite.*(?<!\.exp)$', d.filename): change_msg = ': New test.\n' + pr = get_pr_from_testcase(hunk0.lines[0]) + if pr and pr not in prs: + prs.append(pr) else: change_msg = ": New file.\n" elif hunk0.is_file_removal(): change_msg = ": Remove.\n" _, ext = os.path.splitext(d.filename) - if not change_msg and ext in ['.c', '.cpp', '.C', '.cc', '.h', '.inc', '.def']: + if (not change_msg and ext in ['.c', '.cpp', '.C', '.cc', '.h', '.inc', '.def'] + and not 'testsuite' in d.filename): fns = [] for hunk in d.hunks: for fn in find_changed_funs(hunk): @@ -431,7 +423,7 @@ def main(): logs[log_name] += change_msg if change_msg else ":\n" - if inline and args[0] != '-': + if args.inline and args.input: # Get a temp filename, rather than an open filehandle, because we use # the open to truncate. fd, tmp = tempfile.mkstemp("tmp.XXXXXXXX") @@ -439,7 +431,7 @@ def main(): # Copy permissions to temp file # (old Pythons do not support shutil.copymode) - shutil.copymode(args[0], tmp) + shutil.copymode(args.input, tmp) # Open the temp file, clearing contents. out = open(tmp, 'w') @@ -449,22 +441,26 @@ def main(): # Print log date = time.strftime('%Y-%m-%d') + bugmsg = '' + if len(prs): + bugmsg = '\n'.join(['\t' + pr for pr in prs]) + '\n' + for log_name, msg in sorted(logs.items()): out.write("""\ %s: %s %s <%s> -%s\n""" % (log_name, date, name, email, msg)) +%s%s\n""" % (log_name, date, name, email, bugmsg, msg)) - if inline: + if args.inline: # Append patch body out.write(contents) - if args[0] != '-': + if args.input: # Write new contents atomically out.close() - shutil.move(tmp, args[0]) + shutil.move(tmp, args.input) if __name__ == '__main__': main() diff --git a/contrib/vimrc b/contrib/vimrc index 7c0c587..bbbe1dd 100644 --- a/contrib/vimrc +++ b/contrib/vimrc @@ -31,17 +31,17 @@ function! SetStyle() if stridx(l:fname, 'libsanitizer') != -1 return endif + setlocal tabstop=8 + setlocal softtabstop=2 + setlocal shiftwidth=2 + setlocal noexpandtab + setlocal textwidth=80 + setlocal formatoptions-=ro formatoptions+=cqlt let l:ext = fnamemodify(l:fname, ":e") let l:c_exts = ['c', 'h', 'cpp', 'cc', 'C', 'H', 'def', 'java'] if index(l:c_exts, l:ext) != -1 setlocal cindent - setlocal tabstop=8 - setlocal softtabstop=2 - setlocal shiftwidth=2 - setlocal noexpandtab setlocal cinoptions=>4,n-2,{2,^-2,:2,=2,g0,f0,h2,p4,t0,+2,(0,u0,w1,m0 - setlocal textwidth=80 - setlocal formatoptions-=ro formatoptions+=cqlt endif endfunction |