contrib: introduce Vim addon directory, add match.pd syntax plugin

* vim-gcc-dev/README: New file.
	* vim-gcc-dev/ftdetect/gcc-dev.vim: New file.
	* vim-gcc-dev/syntax/gcc-match.vim: New file.
	* gimple.vim: Move under vim-gcc-dev/syntax/.
	* gcc-rtl.vim: Likewise.

From-SVN: r262249
This commit is contained in:
Alexander Monakov 2018-06-29 16:14:46 +03:00 committed by Alexander Monakov
parent 8864590b7c
commit b33aa7209e
6 changed files with 112 additions and 14 deletions

View File

@ -1,3 +1,11 @@
2018-06-19 Alexander Monakov <amonakov@ispras.ru>
* vim-gcc-dev/README: New file.
* vim-gcc-dev/ftdetect/gcc-dev.vim: New file.
* vim-gcc-dev/syntax/gcc-match.vim: New file.
* gimple.vim: Move under vim-gcc-dev/syntax/.
* gcc-rtl.vim: Likewise.
2018-06-19 Martin Liska <mliska@suse.cz>
* gcc-rtl.vim: New file.

View File

@ -0,0 +1,13 @@
This directory serves as a simple Vim addon for GCC development. It can be
symlinked or copied into Vim plugin directory as any other plugin. For
example, if using vim-pathogen plugin manager:
ln -s /path/to/gcc/contrib/vim-gcc-dev ~/.vim/bundle/
This adds syntax highlighting rules for the match.pd file and GIMPLE/RTL dumps.
You can also use RTL syntax rules for GCC machine desciption files by adding
autocmd BufRead *.md setf gcc-rtl
to your ~/.vimrc file.

View File

@ -0,0 +1,20 @@
" Vim file type detection rules for GCC development
"
" Copyright (C) 2018 Free Software Foundation, Inc.
"
" This script 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, or (at your option)
" any later version
augroup filetypedetect
au BufRead match.pd setf gcc-match
" Match RTL dump file names such as test.c.234r.pass-name
au BufRead *.[1-3][0-9][0-9]r.* setf gcc-rtl
" Match GIMPLE and IPA dump file names
au BufRead *.[0-2][0-9][0-9][ti].* setf gimple
augroup END

View File

@ -0,0 +1,71 @@
" Vim syntax highlighting rules for GCC match-and-simplify language.
"
" Copyright (C) 2018 Free Software Foundation, Inc.
"
" This script 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, or (at your option)
" any later version
if exists("b:current_syntax")
finish
endif
" Some keywords have a question mark, e.g. 'convert?'
setl isk=@,48-57,_,?
syn keyword pdTodo contained TODO FIXME XXX
syn keyword pdCtrl match simplify
syn keyword pdCtrl define_predicates define_operator_list
syn keyword pdCtrl if switch for with
syn keyword pdType type
syn keyword pdOp view_convert view_convert?
\ convert convert? convert1 convert2 convert1? convert2?
\ realpart imagpart
\ cond vec_cond vec_perm
\ pointer_plus pointer_diff
\ plus minus mult mult_highpart
\ trunc_div ceil_div floor_div round_div
\ trunc_mod ceil_mod floor_mod round_mod
\ rdiv exact_div
\ fix_trunc float negate min max abs absu
\ lshift rshift lrotate rrotate
\ bit_ior bit_xor bit_and bit_not
\ truth_andif truth_orif truth_and
\ truth_or truth_xor truth_not
\ lt le gt ge eq ne unordered ordered
\ unlt unle ungt unge uneq ltgt
\ addr_space_convert fixed_convert
\ bit_insert complex conj
\ reduc_max reduc_min reduc_plus
\ dot_prod widen_sum sad fma
\ widen_mult widen_mult_plus widen_mult_minus widen_lshift
\ vec_widen_mult_hi vec_widen_mult_lo
\ vec_widen_mult_even vec_widen_mult_odd
\ vec_unpack_hi vec_unpack_lo
\ vec_unpack_float_hi vec_unpack_float_lo
\ vec_pack_trunc vec_pack_sat vec_pack_fix_trunc
\ vec_widen_lshift_hi vec_widen_lshift_lo
" Match commutative/single-use specifiers: :C, :c, :s, :cs, etc.
syn match pdOpSpec ":[CcSs]\+\>"
syn match pdCapture "@@\?[a-zA-Z0-9_]\+"
syn region pdComment start="/\*" end="\*/" contains=pdTodo
syn region pdPreProc start="^\s*#" skip="\\$" end="$" keepend
hi def link pdCtrl Statement
hi def link pdType Identifier
hi def link pdOp Constant
hi def link pdOpSpec Operator
hi def link pdCapture Special
hi def link pdComment Comment
hi def link pdTodo Todo
hi def link pdPreProc PreProc
let b:current_syntax = "gcc-match"

View File

@ -6,8 +6,6 @@
" it under the terms of the GNU General Public License as published by
" the Free Software Foundation; either version 3, or (at your option)
" any later version
"
" For more instructions please see gimple.vim file in the same folder.
" Do not continue, if syntax is already enabled in current buffer.

View File

@ -11,17 +11,6 @@
" intermediate representation. Such dumps are produced by GCC when
" it is invoked with -fdump-tree-* and/or -fdump-ipa-* switches. Tested
" in Vim 7.4 (but should also work with earlier versions).
"
" INSTALLATION:
" 1. Copy the script into $HOME/.vim/syntax directory
" 2. Create a file gimple.vim in $HOME/.vim/ftdetect directory with the
" following command in it:
"
" au BufRead,BufNewFile *.[0-2][0-9][0-9][ti].* set filetype=gimple
"
" The pattern in this autocommand corresponds to default file names
" of debug dumps, e.g.:
" filename.cc.123t.pass-name
" Do not continue, if syntax is already enabled in current buffer.
@ -155,4 +144,3 @@ hi def link gimpleFrequency Debug
hi def link gimpleBBCount Debug
let b:current_syntax = "gimple"