Hi. This is equivalent of gimple.vim file. I'm aware of not full coverage of RTL instructions, but hope it's a good start point.
Screenshots: https://drive.google.com/open?id=14y-Hca2hf1gyWDfHaht6Wjv-Btf3Bdvl https://drive.google.com/open?id=1LiqsJq2ng-aeKsvw3PhUnDjLWh54Y1Vc Ready for trunk? Thanks, Martin contrib/ChangeLog: 2018-06-12 Martin Liska <mli...@suse.cz> * rtl.vim: New file. --- contrib/rtl.vim | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 contrib/rtl.vim
diff --git a/contrib/rtl.vim b/contrib/rtl.vim new file mode 100644 index 00000000000..c584b56e3f3 --- /dev/null +++ b/contrib/rtl.vim @@ -0,0 +1,55 @@ +" Syntax highlighting rules for RTL dump files (for Vim). +" +" 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 +" +" For more instructions please see gimple.vim file in the same folder. + + +" Do not continue, if syntax is already enabled in current buffer. +if exists("b:current_syntax") + finish +endif + +" General-purpose comments. +syn match rtlComment ";;.*$" + +syn keyword rtlInstruction insn parallel_insn set mem simple_return plus + \ clobber parallel compare minus xor subreg + \ ashift ashiftrt lshiftrt symbol_reg + \ zero_extend symbol_ref label_ref call + \ vec_merge vec_duplicate vec_concat +syn keyword rtlConditional jump_insn if_then_else call_insn eq +syn keyword rtlNote note barrier code_label +syn keyword rtlVariableLoation var_location +syn keyword rtlExpressionList expr_list +syn keyword rtlPcRegister pc + +" String literals +syn region rtlString start=/\v"/ skip=/\v\\./ end=/\v"/ + +syn match rtlNoteInsn "NOTE_INSN_[A-Z_]*" +syn match rtlIntegerConstant "\vconst_int -?\d+" +syn match rtlFloatConstant "\vconst_double:[A-Z]+ -?\d*\.\d+(e\+\d+)?" +syn match rtlRegister "\vreg(\/[a-z])?:[A-Z0-9]+ \d+ [a-z0-9]+" +syn match rtlLocation /\v"[^"]*":\d+/ + +hi def link rtlInstruction Statement +hi def link rtlConditional Conditional +hi def link rtlNote Debug +hi def link rtlNoteInsn Debug +hi def link rtlIntegerConstant Number +hi def link rtlFloatConstant Number +hi def link rtlRegister Type +hi def link rtlPcRegister Type +hi def link rtlVariableLoation Debug +hi def link rtlExpressionList Debug +hi def link rtlComment Comment +hi def link rtlLocation Debug +hi def link rtlString String + +let b:current_syntax = "rtl"