[llvm-commits] [llvm] r61646 - /llvm/trunk/utils/vim/llvm.vim
Dan Gohman
gohman at apple.com
Sun Jan 4 15:09:38 PST 2009
Author: djg
Date: Sun Jan 4 17:09:38 2009
New Revision: 61646
URL: http://llvm.org/viewvc/llvm-project?rev=61646&view=rev
Log:
Update VIM LLVM IR syntax highlighting.
- Add several new keywords
- Clean up some obsolete keywords
- Improve the patterns for constants.
- Add syntax-highlighting for dejagnu test command comments
Modified:
llvm/trunk/utils/vim/llvm.vim
Modified: llvm/trunk/utils/vim/llvm.vim
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/vim/llvm.vim?rev=61646&r1=61645&r2=61646&view=diff
==============================================================================
--- llvm/trunk/utils/vim/llvm.vim (original)
+++ llvm/trunk/utils/vim/llvm.vim Sun Jan 4 17:09:38 2009
@@ -11,42 +11,69 @@
syn case match
+" Types.
+" Types also include struct, array, vector, etc. but these don't
+" benefit as much from having dedicated highlighting rules.
syn keyword llvmType void float double
syn keyword llvmType x86_fp80 fp128 ppc_fp128
syn keyword llvmType type label opaque
syn match llvmType /\<i\d\+\>/
+" Instructions.
+" The true and false tokens can be used for comparison opcodes, but it's
+" much more common for these tokens to be used for boolean constants.
syn keyword llvmStatement add sub mul sdiv udiv fdiv srem urem frem
syn keyword llvmStatement and or xor
syn keyword llvmStatement icmp fcmp
syn keyword llvmStatement eq ne ugt uge ult ule sgt sge slt sle
-syn keyword llvmStatement false oeq ogt oge olt ole one ord ueq ugt uge
-syn keyword llvmStatement ult ule une uno true
-
-syn keyword llvmStatement phi tail call to select shl lshr ashr va_arg
+syn keyword llvmStatement oeq ogt oge olt ole one ord ueq ugt uge
+syn keyword llvmStatement ult ule une uno
+syn keyword llvmStatement phi call select shl lshr ashr va_arg
syn keyword llvmStatement trunc zext sext
syn keyword llvmStatement fptrunc fpext fptoui fptosi uitofp sitofp
syn keyword llvmStatement ptrtoint inttoptr bitcast
syn keyword llvmStatement ret br switch invoke unwind unreachable
syn keyword llvmStatement malloc alloca free load store getelementptr
-
-syn keyword llvmStatement true false zeroinitializer
-syn keyword llvmStatement define declare global constant const
-syn keyword llvmStatement internal uninitialized external implementation
-syn keyword llvmStatement linkonce weak appending
-syn keyword llvmStatement undef null to except target datalayout triple deplibs
-syn keyword llvmStatement big little volatile fastcc coldcc cc
syn keyword llvmStatement extractelement insertelement shufflevector
-syn keyword llvmStatement module asm align
-
-"syn match llvmFunction /%[a-zA-Z\$._\-][a-zA-Z\$._\-0-9]*/
-syn match llvmNumber /\<\d\+\>/
-syn match llvmNumber /\<\d\+\.\d*\>/
-
-syn match llvmComment /;.*$/
-syn region llvmString start=/"/ skip=/\\"/ end=/"/
-syn match llvmLabel /[\-a-zA-Z\$._0-9]*:/
+syn keyword llvmStatement extractvalue insertvalue
+" Keywords.
+syn keyword llvmKeyword define declare global constant
+syn keyword llvmKeyword internal external
+syn keyword llvmKeyword linkonce weak appending common extern_weak
+syn keyword llvmKeyword thread_local dllimport dllexport
+syn keyword llvmKeyword hidden protected
+syn keyword llvmKeyword except deplibs
+syn keyword llvmKeyword volatile fastcc coldcc cc ccc
+syn keyword llvmKeyword x86_stdcallcc x86_fastcallcc
+syn keyword llvmKeyword signext zeroext inreg sret nounwind noreturn
+syn keyword llvmKeyword nocapture byval nest readnone readonly
+syn keyword llvmKeyword noinline alwaysinline optsize ssp sspreq
+syn keyword llvmKeyword module asm align tail to
+syn keyword llvmKeyword addrspace section alias sideeffect c
+syn keyword llvmKeyword target datalayout triple
+
+" Obsolete keywords.
+syn keyword llvmError uninitialized implementation
+syn keyword llvmError getresult big little endian begin end gc
+
+" Misc syntax.
+syn match llvmIgnore /[%@]\d\+\>/
+syn match llvmNumber /-\?\<\d\+\>/
+syn match llvmFloat /-\?\<\d\+\.\d*\(e[+-]\d\+\)\?\>/
+syn match llvmFloat /\<0x\x\+\>/
+syn keyword llvmBoolean true false
+syn keyword llvmConstant zeroinitializer undef null
+syn match llvmComment /;.*$/
+syn region llvmString start=/"/ skip=/\\"/ end=/"/
+syn match llvmLabel /[\-a-zA-Z\$._0-9]*:/
+
+" Syntax-highlight dejagnu test commands.
+syn match llvmSpecialComment /;\s*RUN:.*$/
+syn match llvmSpecialComment /;\s*PR\d*\s*$/
+syn match llvmSpecialComment /;\s*END\.\s*$/
+syn match llvmSpecialComment /;\s*XFAIL:.*$/
+syn match llvmSpecialComment /;\s*XTARGET:.*$/
if version >= 508 || !exists("did_c_syn_inits")
if version < 508
@@ -62,6 +89,13 @@
HiLink llvmComment Comment
HiLink llvmString String
HiLink llvmLabel Label
+ HiLink llvmKeyword Keyword
+ HiLink llvmBoolean Boolean
+ HiLink llvmFloat Float
+ HiLink llvmIgnore Ignore
+ HiLink llvmConstant Constant
+ HiLink llvmSpecialComment SpecialComment
+ HiLink llvmError Error
delcommand HiLink
endif
More information about the llvm-commits
mailing list