1" Vim syntax file 2" Language: llvm 3" Maintainer: The LLVM team, http://llvm.org/ 4" Version: $Revision$ 5 6if version < 600 7 syntax clear 8elseif exists("b:current_syntax") 9 finish 10endif 11 12syn case match 13 14" Types. 15" Types also include struct, array, vector, etc. but these don't 16" benefit as much from having dedicated highlighting rules. 17syn keyword llvmType void half float double x86_fp80 fp128 ppc_fp128 18syn keyword llvmType label metadata x86_mmx 19syn keyword llvmType type label opaque 20syn match llvmType /\<i\d\+\>/ 21 22" Instructions. 23" The true and false tokens can be used for comparison opcodes, but it's 24" much more common for these tokens to be used for boolean constants. 25syn keyword llvmStatement add alloca and arcp ashr atomicrmw bitcast br call 26syn keyword llvmStatement cmpxchg eq exact extractelement extractvalue fadd fast 27syn keyword llvmStatement fcmp fdiv fence fmul fpext fptosi fptoui fptrunc free 28syn keyword llvmStatement frem fsub getelementptr icmp inbounds indirectbr 29syn keyword llvmStatement insertelement insertvalue inttoptr invoke landingpad 30syn keyword llvmStatement load lshr malloc max min mul nand ne ninf nnan nsw nsz 31syn keyword llvmStatement nuw oeq oge ogt ole olt one or ord phi ptrtoint resume 32syn keyword llvmStatement ret sdiv select sext sge sgt shl shufflevector sitofp 33syn keyword llvmStatement sle slt srem store sub switch trunc udiv ueq uge ugt 34syn keyword llvmStatement uitofp ule ult umax umin une uno unreachable unwind 35syn keyword llvmStatement urem va_arg xchg xor zext 36 37" Keywords. 38syn keyword llvmKeyword acq_rel acquire sanitize_address addrspace alias align 39syn keyword llvmKeyword alignstack alwaysinline appending arm_aapcs_vfpcc 40syn keyword llvmKeyword arm_aapcscc arm_apcscc asm atomic available_externally 41syn keyword llvmKeyword blockaddress byval c catch cc ccc cleanup coldcc common 42syn keyword llvmKeyword constant datalayout declare default define deplibs 43syn keyword llvmKeyword dllexport dllimport except extern_weak external fastcc 44syn keyword llvmKeyword filter gc global hidden initialexec inlinehint inreg 45syn keyword llvmKeyword intel_ocl_bicc inteldialect internal linker_private 46syn keyword llvmKeyword linker_private_weak linker_private_weak_def_auto 47syn keyword llvmKeyword linkonce linkonce_odr linkonce_odr_auto_hide 48syn keyword llvmKeyword localdynamic localexec minsize module monotonic 49syn keyword llvmKeyword msp430_intrcc naked nest noalias nocapture 50syn keyword llvmKeyword noimplicitfloat noinline nonlazybind noredzone noreturn 51syn keyword llvmKeyword nounwind optsize personality private protected 52syn keyword llvmKeyword ptx_device ptx_kernel readnone readonly release 53syn keyword llvmKeyword returns_twice sanitize_thread sanitize_memory 54syn keyword llvmKeyword section seq_cst sideeffect signext singlethread 55syn keyword llvmKeyword spir_func spir_kernel sret ssp sspreq sspstrong 56syn keyword llvmKeyword tail target thread_local to triple unnamed_addr 57syn keyword llvmKeyword unordered uwtable volatile weak weak_odr 58syn keyword llvmKeyword x86_fastcallcc x86_stdcallcc x86_thiscallcc x86_64_sysvcc 59syn keyword llvmKeyword x86_64_win64cc zeroext 60 61" Obsolete keywords. 62syn keyword llvmError getresult begin end 63 64" Misc syntax. 65syn match llvmNoName /[%@]\d\+\>/ 66syn match llvmNumber /-\?\<\d\+\>/ 67syn match llvmFloat /-\?\<\d\+\.\d*\(e[+-]\d\+\)\?\>/ 68syn match llvmFloat /\<0x\x\+\>/ 69syn keyword llvmBoolean true false 70syn keyword llvmConstant zeroinitializer undef null 71syn match llvmComment /;.*$/ 72syn region llvmString start=/"/ skip=/\\"/ end=/"/ 73syn match llvmLabel /[-a-zA-Z$._][-a-zA-Z$._0-9]*:/ 74syn match llvmIdentifier /[%@][-a-zA-Z$._][-a-zA-Z$._0-9]*/ 75 76" Syntax-highlight dejagnu test commands. 77syn match llvmSpecialComment /;\s*RUN:.*$/ 78syn match llvmSpecialComment /;\s*PR\d*\s*$/ 79syn match llvmSpecialComment /;\s*END\.\s*$/ 80syn match llvmSpecialComment /;\s*XFAIL:.*$/ 81 82if version >= 508 || !exists("did_c_syn_inits") 83 if version < 508 84 let did_c_syn_inits = 1 85 command -nargs=+ HiLink hi link <args> 86 else 87 command -nargs=+ HiLink hi def link <args> 88 endif 89 90 HiLink llvmType Type 91 HiLink llvmStatement Statement 92 HiLink llvmNumber Number 93 HiLink llvmComment Comment 94 HiLink llvmString String 95 HiLink llvmLabel Label 96 HiLink llvmKeyword Keyword 97 HiLink llvmBoolean Boolean 98 HiLink llvmFloat Float 99 HiLink llvmNoName Identifier 100 HiLink llvmConstant Constant 101 HiLink llvmSpecialComment SpecialComment 102 HiLink llvmError Error 103 HiLink llvmIdentifier Identifier 104 105 delcommand HiLink 106endif 107 108let b:current_syntax = "llvm" 109