Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update LLVM lexer to use keywords of LLVM 12.0. #1824

Merged
merged 1 commit into from May 31, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
141 changes: 84 additions & 57 deletions pygments/lexers/asm.py
Expand Up @@ -384,68 +384,95 @@ class LlvmLexer(RegexLexer):
'keyword': [
# Regular keywords
(words((
'acq_rel', 'acquire', 'add', 'addrspace', 'addrspacecast', 'afn', 'alias',
'aliasee', 'align', 'alignLog2', 'alignstack', 'alloca', 'allocsize', 'allOnes',
'alwaysinline', 'amdgpu_cs', 'amdgpu_es', 'amdgpu_gs', 'amdgpu_hs',
'amdgpu_kernel', 'amdgpu_ls', 'amdgpu_ps', 'amdgpu_vs', 'and', 'any',
'anyregcc', 'appending', 'arcp', 'argmemonly', 'args', 'arm_aapcs_vfpcc',
'arm_aapcscc', 'arm_apcscc', 'ashr', 'asm', 'atomic', 'atomicrmw', 'attributes',
'available_externally', 'avr_intrcc', 'avr_signalcc', 'bit', 'bitcast',
'bitMask', 'blockaddress', 'br', 'branchFunnel', 'builtin', 'byArg', 'byte',
'byteArray', 'byval', 'c', 'call', 'callee', 'caller', 'calls', 'catch',
'catchpad', 'catchret', 'catchswitch', 'cc', 'ccc', 'cleanup', 'cleanuppad',
'cleanupret', 'cmpxchg', 'cold', 'coldcc', 'comdat', 'common', 'constant',
'contract', 'convergent', 'critical', 'cxx_fast_tlscc', 'datalayout', 'declare',
'default', 'define', 'deplibs', 'dereferenceable', 'dereferenceable_or_null',
'distinct', 'dllexport', 'dllimport', 'dso_local', 'dso_preemptable',
'dsoLocal', 'eq', 'exact', 'exactmatch', 'extern_weak', 'external',
'externally_initialized', 'extractelement', 'extractvalue', 'fadd', 'false',
'fast', 'fastcc', 'fcmp', 'fdiv', 'fence', 'filter', 'flags', 'fmul',
'fpext', 'fptosi', 'fptoui', 'fptrunc', 'freeze', 'frem', 'from', 'fsub',
'funcFlags', 'function', 'gc', 'getelementptr', 'ghccc', 'global', 'guid', 'gv',
'hash', 'hhvm_ccc', 'hhvmcc', 'hidden', 'hot', 'hotness', 'icmp',
'ifunc', 'inaccessiblemem_or_argmemonly', 'inaccessiblememonly', 'inalloca',
'inbounds', 'indir', 'indirectbr', 'info', 'initialexec', 'inline',
'inlineBits', 'inlinehint', 'inrange', 'inreg', 'insertelement', 'insertvalue',
'insts', 'intel_ocl_bicc', 'inteldialect', 'internal', 'inttoptr', 'invoke',
'jumptable', 'kind', 'landingpad', 'largest', 'linkage', 'linkonce',
'linkonce_odr', 'live', 'load', 'local_unnamed_addr', 'localdynamic',
'localexec', 'lshr', 'max', 'metadata', 'min', 'minsize', 'module', 'monotonic',
'msp430_intrcc', 'mul', 'musttail', 'naked', 'name', 'nand', 'ne', 'nest',
'ninf', 'nnan', 'noalias', 'nobuiltin', 'nocapture', 'nocf_check',
'noduplicate', 'noduplicates', 'noimplicitfloat', 'noinline', 'none',
'nonlazybind', 'nonnull', 'norecurse', 'noRecurse', 'noredzone', 'noreturn',
'notail', 'notEligibleToImport', 'nounwind', 'nsw', 'nsz', 'null', 'nuw', 'oeq',
'offset', 'oge', 'ogt', 'ole', 'olt', 'one', 'opaque', 'optforfuzzing',
'optnone', 'optsize', 'or', 'ord', 'path', 'personality', 'phi', 'poison',
'prefix', 'preserve_allcc', 'preserve_mostcc', 'private', 'prologue',
'protected', 'ptrtoint', 'ptx_device', 'ptx_kernel', 'readnone', 'readNone',
'readonly', 'readOnly', 'reassoc', 'refs', 'relbf', 'release', 'resByArg',
'resume', 'ret', 'returnDoesNotAlias', 'returned', 'returns_twice', 'safestack',
'samesize', 'sanitize_address', 'sanitize_hwaddress', 'sanitize_memory',
'sanitize_thread', 'sdiv', 'section', 'select', 'seq_cst', 'sext', 'sge', 'sgt',
'shadowcallstack', 'shl', 'shufflevector', 'sideeffect', 'signext', 'single',
'singleImpl', 'singleImplName', 'sitofp', 'sizeM1', 'sizeM1BitWidth', 'sle',
'slt', 'source_filename', 'speculatable', 'spir_func', 'spir_kernel', 'srem',
'sret', 'ssp', 'sspreq', 'sspstrong', 'store', 'strictfp', 'sub', 'summaries',
'summary', 'swiftcc', 'swifterror', 'swiftself', 'switch', 'syncscope', 'tail',
'target', 'thread_local', 'to', 'token', 'triple', 'true', 'trunc', 'type',
'typeCheckedLoadConstVCalls', 'typeCheckedLoadVCalls', 'typeid', 'typeIdInfo',
'typeTestAssumeConstVCalls', 'typeTestAssumeVCalls', 'typeTestRes', 'typeTests',
'udiv', 'ueq', 'uge', 'ugt', 'uitofp', 'ule', 'ult', 'umax', 'umin', 'undef',
'une', 'uniformRetVal', 'uniqueRetVal', 'unknown', 'unnamed_addr', 'uno',
'unordered', 'unreachable', 'unsat', 'unwind', 'urem', 'uselistorder',
'uselistorder_bb', 'uwtable', 'va_arg', 'variable', 'vFuncId',
'virtualConstProp', 'void', 'volatile', 'weak', 'weak_odr', 'webkit_jscc',
'aarch64_sve_vector_pcs', 'aarch64_vector_pcs', 'acq_rel',
'acquire', 'add', 'addrspace', 'addrspacecast', 'afn', 'alias',
'aliasee', 'align', 'alignLog2', 'alignstack', 'alloca',
'allocsize', 'allOnes', 'alwaysinline', 'alwaysInline',
'amdgpu_cs', 'amdgpu_es', 'amdgpu_gfx', 'amdgpu_gs',
'amdgpu_hs', 'amdgpu_kernel', 'amdgpu_ls', 'amdgpu_ps',
'amdgpu_vs', 'and', 'any', 'anyregcc', 'appending', 'arcp',
'argmemonly', 'args', 'arm_aapcs_vfpcc', 'arm_aapcscc',
'arm_apcscc', 'ashr', 'asm', 'atomic', 'atomicrmw',
'attributes', 'available_externally', 'avr_intrcc',
'avr_signalcc', 'bit', 'bitcast', 'bitMask', 'blockaddress',
'blockcount', 'br', 'branchFunnel', 'builtin', 'byArg',
'byref', 'byte', 'byteArray', 'byval', 'c', 'call', 'callbr',
'callee', 'caller', 'calls', 'canAutoHide', 'catch',
'catchpad', 'catchret', 'catchswitch', 'cc', 'ccc',
'cfguard_checkcc', 'cleanup', 'cleanuppad', 'cleanupret',
'cmpxchg', 'cold', 'coldcc', 'comdat', 'common', 'constant',
'contract', 'convergent', 'critical', 'cxx_fast_tlscc',
'datalayout', 'declare', 'default', 'define', 'deplibs',
'dereferenceable', 'dereferenceable_or_null', 'distinct',
'dllexport', 'dllimport', 'dso_local', 'dso_local_equivalent',
'dso_preemptable', 'dsoLocal', 'eq', 'exact', 'exactmatch',
'extern_weak', 'external', 'externally_initialized',
'extractelement', 'extractvalue', 'fadd', 'false', 'fast',
'fastcc', 'fcmp', 'fdiv', 'fence', 'filter', 'flags', 'fmul',
'fneg', 'fpext', 'fptosi', 'fptoui', 'fptrunc', 'freeze',
'frem', 'from', 'fsub', 'funcFlags', 'function', 'gc',
'getelementptr', 'ghccc', 'global', 'guid', 'gv', 'hash',
'hhvm_ccc', 'hhvmcc', 'hidden', 'hot', 'hotness', 'icmp',
'ifunc', 'inaccessiblemem_or_argmemonly',
'inaccessiblememonly', 'inalloca', 'inbounds', 'indir',
'indirectbr', 'info', 'initialexec', 'inline', 'inlineBits',
'inlinehint', 'inrange', 'inreg', 'insertelement',
'insertvalue', 'insts', 'intel_ocl_bicc', 'inteldialect',
'internal', 'inttoptr', 'invoke', 'jumptable', 'kind',
'landingpad', 'largest', 'linkage', 'linkonce', 'linkonce_odr',
'live', 'load', 'local_unnamed_addr', 'localdynamic',
'localexec', 'lshr', 'max', 'metadata', 'min', 'minsize',
'module', 'monotonic', 'msp430_intrcc', 'mul', 'mustprogress',
'musttail', 'naked', 'name', 'nand', 'ne', 'nest', 'ninf',
'nnan', 'noalias', 'nobuiltin', 'nocallback', 'nocapture',
'nocf_check', 'noduplicate', 'noduplicates', 'nofree',
'noimplicitfloat', 'noinline', 'noInline', 'nomerge', 'none',
'nonlazybind', 'nonnull', 'noprofile', 'norecurse',
'noRecurse', 'noredzone', 'noreturn', 'nosync', 'notail',
'notEligibleToImport', 'noundef', 'nounwind', 'nsw',
'nsz', 'null', 'null_pointer_is_valid', 'nuw', 'oeq', 'offset',
'oge', 'ogt', 'ole', 'olt', 'one', 'opaque', 'optforfuzzing',
'optnone', 'optsize', 'or', 'ord', 'param', 'params',
'partition', 'path', 'personality', 'phi', 'poison',
'preallocated', 'prefix', 'preserve_allcc', 'preserve_mostcc',
'private', 'prologue', 'protected', 'ptrtoint', 'ptx_device',
'ptx_kernel', 'readnone', 'readNone', 'readonly', 'readOnly',
'reassoc', 'refs', 'relbf', 'release', 'resByArg', 'resume',
'ret', 'returnDoesNotAlias', 'returned', 'returns_twice',
'safestack', 'samesize', 'sanitize_address',
'sanitize_hwaddress', 'sanitize_memory', 'sanitize_memtag',
'sanitize_thread', 'sdiv', 'section', 'select', 'seq_cst',
'sext', 'sge', 'sgt', 'shadowcallstack', 'shl',
'shufflevector', 'sideeffect', 'signext', 'single',
'singleImpl', 'singleImplName', 'sitofp', 'sizeM1',
'sizeM1BitWidth', 'sle', 'slt', 'source_filename',
'speculatable', 'speculative_load_hardening', 'spir_func',
'spir_kernel', 'srem', 'sret', 'ssp', 'sspreq', 'sspstrong',
'store', 'strictfp', 'sub', 'summaries', 'summary', 'swiftcc',
'swifterror', 'swiftself', 'switch', 'syncscope', 'tail',
'tailcc', 'target', 'thread_local', 'to', 'token', 'triple',
'true', 'trunc', 'type', 'typeCheckedLoadConstVCalls',
'typeCheckedLoadVCalls', 'typeid', 'typeidCompatibleVTable',
'typeIdInfo', 'typeTestAssumeConstVCalls',
'typeTestAssumeVCalls', 'typeTestRes', 'typeTests', 'udiv',
'ueq', 'uge', 'ugt', 'uitofp', 'ule', 'ult', 'umax', 'umin',
'undef', 'une', 'uniformRetVal', 'uniqueRetVal', 'unknown',
'unnamed_addr', 'uno', 'unordered', 'unreachable', 'unsat',
'unwind', 'urem', 'uselistorder', 'uselistorder_bb', 'uwtable',
'va_arg', 'varFlags', 'variable', 'vcall_visibility',
'vFuncId', 'virtFunc', 'virtualConstProp', 'void', 'volatile',
'vscale', 'vTableFuncs', 'weak', 'weak_odr', 'webkit_jscc',
'win64cc', 'within', 'wpdRes', 'wpdResolutions', 'writeonly',
'x86_64_sysvcc', 'x86_fastcallcc', 'x86_intrcc', 'x86_mmx',
'x86_regcallcc', 'x86_stdcallcc', 'x86_thiscallcc', 'x86_vectorcallcc', 'xchg',
'xor', 'zeroext', 'zeroinitializer', 'zext', 'immarg', 'willreturn'),
'x', 'x86_64_sysvcc', 'x86_fastcallcc', 'x86_intrcc',
'x86_mmx', 'x86_regcallcc', 'x86_stdcallcc', 'x86_thiscallcc',
'x86_vectorcallcc', 'xchg', 'xor', 'zeroext',
'zeroinitializer', 'zext', 'immarg', 'willreturn'),
suffix=r'\b'), Keyword),

# Types
(words(('void', 'half', 'bfloat', 'float', 'double', 'fp128',
'x86_fp80', 'ppc_fp128', 'label', 'metadata', 'token')),
'x86_fp80', 'ppc_fp128', 'label', 'metadata', 'x86_mmx',
'x86_amx', 'token')),
Keyword.Type),

# Integer types
Expand Down