2002-10-08 00:54:48 +02:00
|
|
|
" Vim syntax file
|
2003-06-03 02:56:09 +02:00
|
|
|
" Language: llvm
|
2006-03-14 06:54:52 +01:00
|
|
|
" Maintainer: The LLVM team, http://llvm.org/
|
2010-02-26 22:38:04 +01:00
|
|
|
" Version: $Revision$
|
2002-10-08 00:54:48 +02:00
|
|
|
|
|
|
|
if version < 600
|
|
|
|
syntax clear
|
|
|
|
elseif exists("b:current_syntax")
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
|
|
|
|
syn case match
|
|
|
|
|
2009-01-05 00:09:38 +01:00
|
|
|
" Types.
|
|
|
|
" Types also include struct, array, vector, etc. but these don't
|
|
|
|
" benefit as much from having dedicated highlighting rules.
|
2008-01-29 13:35:50 +01:00
|
|
|
syn keyword llvmType void float double
|
|
|
|
syn keyword llvmType x86_fp80 fp128 ppc_fp128
|
2002-10-08 00:54:48 +02:00
|
|
|
syn keyword llvmType type label opaque
|
2008-01-29 13:35:50 +01:00
|
|
|
syn match llvmType /\<i\d\+\>/
|
2002-10-08 00:54:48 +02:00
|
|
|
|
2009-01-05 00:09:38 +01:00
|
|
|
" 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.
|
2009-06-05 00:49:04 +02:00
|
|
|
syn keyword llvmStatement add fadd sub fsub mul fmul
|
|
|
|
syn keyword llvmStatement sdiv udiv fdiv srem urem frem
|
2002-10-08 00:54:48 +02:00
|
|
|
syn keyword llvmStatement and or xor
|
2008-01-29 13:35:50 +01:00
|
|
|
syn keyword llvmStatement icmp fcmp
|
|
|
|
syn keyword llvmStatement eq ne ugt uge ult ule sgt sge slt sle
|
2009-01-05 00:09:38 +01:00
|
|
|
syn keyword llvmStatement oeq ogt oge olt ole one ord ueq ugt uge
|
|
|
|
syn keyword llvmStatement ult ule une uno
|
2009-07-27 23:54:51 +02:00
|
|
|
syn keyword llvmStatement nuw nsw exact inbounds
|
2009-01-05 00:09:38 +01:00
|
|
|
syn keyword llvmStatement phi call select shl lshr ashr va_arg
|
2008-01-29 13:35:50 +01:00
|
|
|
syn keyword llvmStatement trunc zext sext
|
|
|
|
syn keyword llvmStatement fptrunc fpext fptoui fptosi uitofp sitofp
|
|
|
|
syn keyword llvmStatement ptrtoint inttoptr bitcast
|
2009-10-29 01:14:44 +01:00
|
|
|
syn keyword llvmStatement ret br indirectbr switch invoke unwind unreachable
|
2002-10-08 00:54:48 +02:00
|
|
|
syn keyword llvmStatement malloc alloca free load store getelementptr
|
2008-01-29 13:35:50 +01:00
|
|
|
syn keyword llvmStatement extractelement insertelement shufflevector
|
2009-01-05 00:09:38 +01:00
|
|
|
syn keyword llvmStatement extractvalue insertvalue
|
|
|
|
|
|
|
|
" Keywords.
|
|
|
|
syn keyword llvmKeyword define declare global constant
|
2009-07-17 03:06:53 +02:00
|
|
|
syn keyword llvmKeyword internal external private
|
Introduce new linkage types linkonce_odr, weak_odr, common_odr
and extern_weak_odr. These are the same as the non-odr versions,
except that they indicate that the global will only be overridden
by an *equivalent* global. In C, a function with weak linkage can
be overridden by a function which behaves completely differently.
This means that IP passes have to skip weak functions, since any
deductions made from the function definition might be wrong, since
the definition could be replaced by something completely different
at link time. This is not allowed in C++, thanks to the ODR
(One-Definition-Rule): if a function is replaced by another at
link-time, then the new function must be the same as the original
function. If a language knows that a function or other global can
only be overridden by an equivalent global, it can give it the
weak_odr linkage type, and the optimizers will understand that it
is alright to make deductions based on the function body. The
code generators on the other hand map weak and weak_odr linkage
to the same thing.
llvm-svn: 66339
2009-03-07 16:45:40 +01:00
|
|
|
syn keyword llvmKeyword linkonce linkonce_odr weak weak_odr appending
|
2009-03-11 21:14:15 +01:00
|
|
|
syn keyword llvmKeyword common extern_weak
|
2009-01-05 00:09:38 +01:00
|
|
|
syn keyword llvmKeyword thread_local dllimport dllexport
|
2009-01-05 18:44:11 +01:00
|
|
|
syn keyword llvmKeyword hidden protected default
|
2009-01-05 00:09:38 +01:00
|
|
|
syn keyword llvmKeyword except deplibs
|
|
|
|
syn keyword llvmKeyword volatile fastcc coldcc cc ccc
|
|
|
|
syn keyword llvmKeyword x86_stdcallcc x86_fastcallcc
|
2010-09-25 09:46:17 +02:00
|
|
|
syn keyword llvmKeyword ptx_kernel ptx_device
|
2009-01-05 00:09:38 +01:00
|
|
|
syn keyword llvmKeyword signext zeroext inreg sret nounwind noreturn
|
2011-08-17 04:29:07 +02:00
|
|
|
syn keyword llvmKeyword nocapture byval nest readnone readonly noalias uwtable
|
2010-02-06 02:16:28 +01:00
|
|
|
syn keyword llvmKeyword inlinehint noinline alwaysinline optsize ssp sspreq
|
2010-02-26 22:16:17 +01:00
|
|
|
syn keyword llvmKeyword noredzone noimplicitfloat naked alignstack
|
2009-01-05 00:09:38 +01:00
|
|
|
syn keyword llvmKeyword module asm align tail to
|
2009-01-05 04:22:02 +01:00
|
|
|
syn keyword llvmKeyword addrspace section alias sideeffect c gc
|
2009-01-05 00:09:38 +01:00
|
|
|
syn keyword llvmKeyword target datalayout triple
|
2009-10-29 01:14:44 +01:00
|
|
|
syn keyword llvmKeyword blockaddress
|
2002-10-08 00:54:48 +02:00
|
|
|
|
2009-01-05 00:09:38 +01:00
|
|
|
" Obsolete keywords.
|
2010-08-28 22:14:05 +02:00
|
|
|
syn keyword llvmError getresult begin end
|
2002-10-08 00:54:48 +02:00
|
|
|
|
2009-01-05 00:09:38 +01:00
|
|
|
" Misc syntax.
|
2010-07-29 19:57:57 +02:00
|
|
|
syn match llvmNoName /[%@]\d\+\>/
|
2009-01-05 00:09:38 +01:00
|
|
|
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=/"/
|
2010-01-09 18:22:48 +01:00
|
|
|
syn match llvmLabel /[-a-zA-Z$._][-a-zA-Z$._0-9]*:/
|
|
|
|
syn match llvmIdentifier /[%@][-a-zA-Z$._][-a-zA-Z$._0-9]*/
|
2002-10-08 00:54:48 +02:00
|
|
|
|
2009-01-05 00:09:38 +01:00
|
|
|
" 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:.*$/
|
2002-10-08 00:54:48 +02:00
|
|
|
|
|
|
|
if version >= 508 || !exists("did_c_syn_inits")
|
|
|
|
if version < 508
|
|
|
|
let did_c_syn_inits = 1
|
|
|
|
command -nargs=+ HiLink hi link <args>
|
|
|
|
else
|
|
|
|
command -nargs=+ HiLink hi def link <args>
|
|
|
|
endif
|
|
|
|
|
|
|
|
HiLink llvmType Type
|
|
|
|
HiLink llvmStatement Statement
|
|
|
|
HiLink llvmNumber Number
|
|
|
|
HiLink llvmComment Comment
|
|
|
|
HiLink llvmString String
|
|
|
|
HiLink llvmLabel Label
|
2009-01-05 00:09:38 +01:00
|
|
|
HiLink llvmKeyword Keyword
|
|
|
|
HiLink llvmBoolean Boolean
|
|
|
|
HiLink llvmFloat Float
|
2010-07-29 19:57:57 +02:00
|
|
|
HiLink llvmNoName Identifier
|
2009-01-05 00:09:38 +01:00
|
|
|
HiLink llvmConstant Constant
|
|
|
|
HiLink llvmSpecialComment SpecialComment
|
|
|
|
HiLink llvmError Error
|
2010-01-09 18:22:48 +01:00
|
|
|
HiLink llvmIdentifier Identifier
|
2002-10-08 00:54:48 +02:00
|
|
|
|
|
|
|
delcommand HiLink
|
|
|
|
endif
|
2009-01-02 17:26:14 +01:00
|
|
|
|
2002-10-08 00:54:48 +02:00
|
|
|
let b:current_syntax = "llvm"
|