rs6000.md (extendtfif2): Add missing 128-bit conversion insn that shows up when...
[official-gcc.git] / contrib / gimple.vim
blobbee1319e57593196d64787a92308044c24d526dd
1 " Syntax highlighting rules for GIMPLE dump files (for Vim).
3 " Copyright (C) 2015 Free Software Foundation, Inc.
5 " This script is free software; you can redistribute it and/or modify
6 " it under the terms of the GNU General Public License as published by
7 " the Free Software Foundation; either version 3, or (at your option)
8 " any later version
10 " This Vim script highlights syntax in debug dumps containing GIMPLE
11 " intermediate representation.  Such dumps are produced by GCC when
12 " it is invoked with -fdump-tree-* and/or -fdump-ipa-* switches.  Tested
13 " in Vim 7.4 (but should also work with earlier versions).
15 " INSTALLATION:
16 " 1. Copy the script into $HOME/.vim/syntax directory
17 " 2. Create a file gimple.vim in $HOME/.vim/ftdetect directory with the
18 "    following command in it:
20 " au BufRead,BufNewFile *.[0-2][0-9][0-9][ti].* set filetype=gimple
22 " The pattern in this autocommand corresponds to default file names
23 " of debug dumps, e.g.:
24 " filename.cc.123t.pass-name
27 " Do not continue, if syntax is already enabled in current buffer.
28 if exists("b:current_syntax")
29     finish
30 endif
32 " If this variable is set to true, "Unknown tree" in -fdump-tree-original will
33 " be highlighted as an error.
34 let s:unknown_tree_is_error=0
36 " Comments for Phi nodes, value ranges, use/def-chains, etc.
37 syn match   gimpleAnnotation    "\v#.*$"
38             \ contains=gimpleAnnotationOp, gimpleAnnotationMark,
39             \ gimpleNumber, gimpleLineNo
40 syn match   gimpleAnnotationMark    "#" contained
41 syn keyword gimpleAnnotationOp    PHI VUSE VDEF RANGE PT USE CLB
42             \ ALIGN MISALIGN NONZERO contained
44 " General-purpose comments.
45 syn match   gimpleComment       ";;.*$"
47 " Types - mostly borrowed from original Vim syntax file for C
48 syn keyword     gimpleType  int long short char void
49             \ signed unsigned float double
50             \ size_t ssize_t off_t wchar_t ptrdiff_t sig_atomic_t fpos_t
51             \ clock_t time_t va_list jmp_buf FILE DIR div_t ldiv_t
52             \ mbstate_t wctrans_t wint_t wctype_t
53             \ _Bool bool _Complex complex _Imaginary imaginary
54             \ int8_t int16_t int32_t int64_t
55             \ uint8_t uint16_t uint32_t uint64_t
56             \ int_least8_t int_least16_t int_least32_t int_least64_t
57             \ uint_least8_t uint_least16_t uint_least32_t uint_least64_t
58             \ int_fast8_t int_fast16_t int_fast32_t int_fast64_t
59             \ uint_fast8_t uint_fast16_t uint_fast32_t uint_fast64_t
60             \ intptr_t uintptr_t
61             \ intmax_t uintmax_t
62             \ __label__ __complex__ __volatile__
63             \ char16_t char32_t sizetype __vtbl_ptr_type
65 " C/C++-like control structures
66 syn keyword gimpleStatement     goto return
67 syn keyword gimpleConditional   if else
68 syn keyword gimpleLoop          while
69 syn keyword gimpleException     try catch finally
71 " Special 'values'
72 syn match   gimpleConstant      "{CLOBBER}"
73 syn match   gimpleConstant      "{ref-all}"
74 syn match   gimpleConstant      "{v}"
76 " Blocks
77 syn region  gimpleBlock         start="{" end="}" transparent fold
79 " String literals
80 syn region  gimpleString        start=/\v"/ skip=/\v\\./ end=/\v"/
82 " GENERIC AST nodes
83 syn keyword gimpleASTNode       BIT_FIELD_REF TARGET_EXPR expr_stmt
84             \ NON_LVALUE_EXPR
85             \ must_not_throw_expr eh_spec_block eh_filter
86             \ eh_must_not_throw aggr_init_expr cleanup_point
88 if s:unknown_tree_is_error
89     syn match   gimpleUnknownTree   "\vUnknown tree: \w+"
90 end
92 " Ignore probability of edges and basic blocks
93 "  <bb 2> [70.00%]:
94 syn match   gimpleFrequency     " \[\d*\.\d*%\]"
96 " Ignore basic block with a count
97 "  <bb 10> [local count: 118111601]:
98 syn match   gimpleBBCount       "\v\[(local )?count: \d+\]"
100 " Numbers
101 syn match   gimpleNumber        "\v([^.a-zA-Z0-9_])\zs-?\d+B?"
102 syn match   gimpleFloat         "\v\W\zs-?\d*\.\d+(e\+\d+)?"
104 " Basic block label
105 " <bb 123>:
106 syn match   gimpleLabel         "\v^\s*\zs\<bb \d+\>"
107 " <D.1234>:
108 " <L1>:
109 syn match   gimpleLabel         "\v^\s*\zs\<[DL]\.?\d+\>"
110 " label: - user-defined label
111 " bb1L.1:
112 syn match   gimpleLabel         "\v^\s*[a-zA-Z0-9._]+\ze:\s*$"
114 " Match label after goto to suppress highlighting of numbers inside
115 syn match   gimpleGotoLabel     "\v<bb \d+\>[^:]"
117 " Line numbers, generated with -fdump-tree-*-lineno
118 syn match   gimpleLineNo        "\v\[[^\]]+:\d+:\d+\]"
120 " DEBUG statements
121 syn match   gimpleDebug         "\v# DEBUG.*"
123 " GIMPLE predict statement
124 syn match   gimplePrediction    "\v\/\/ predicted.*"
127 " Misc C/C++-like keywords
128 syn keyword gimpleStructure     struct union enum typedef class
129 syn keyword gimpleStorageClass  static register auto volatile extern const
130             \ template inline __attribute__ _Alignas alignas _Atomic
131             \ _Thread_local thread_local _Alignof alignof sizeof
133 hi def link gimpleType          Type
134 hi def link gimpleNumber        Number
135 hi def link gimpleFloat         Float
136 hi def link gimpleConstant      Constant
137 hi def link gimpleStructure     Structure
138 hi def link gimpleStorageClass  StorageClass
139 hi def link gimpleOperator      Operator
140 hi def link gimpleASTNode       Operator
141 hi def link gimpleStatement     Statement
142 hi def link gimpleConditional   Conditional
143 hi def link gimpleLoop          Repeat
144 hi def link gimpleException     Exception
145 hi def link gimpleComment       Comment
146 hi def link gimpleLineNo        Comment
147 hi def link gimpleLabel         Label
148 hi def link gimpleAnnotationOp  Debug
149 hi def link gimpleAnnotationMark Debug
150 hi def link gimpleString        String
151 hi def link gimpleUnknownTree   Error
152 hi def link gimpleDebug         Debug
153 hi def link gimplePrediction    Debug
154 hi def link gimpleFrequency     Debug
155 hi def link gimpleBBCount       Debug
157 let b:current_syntax = "gimple"