From 2da21a1bd466c7f42dd07a3da2d4501e95731951 Mon Sep 17 00:00:00 2001 From: Andrzej Warzynski Date: Fri, 5 Mar 2021 17:36:09 +0000 Subject: [PATCH] [Utils] Add missing attributes in syntax files Added the following attributes to all LLVM syntax files: * allocsize * cold * convergent * dereferenceable_or_null * hot * inaccessiblemem_or_argmemonly * inaccessiblememonly * inalloca * jumptable * nocallback * nocf_check * noduplicate * nofree * nomerge * noprofile * nosync * null_pointer_is_valid * optforfuzzing * preallocated * safestack * sanitize_hwaddress * sanitize_memtag * shadowcallstack * speculative_load_hardening * swifterror * syncscope * tailcc * willreturn I generated that list by comparing: * Attributes.inc (generated from Attributes.td), and * the Vim syntax file: llvm/utils/vim/syntax/llvm.vim My original intention was to focus on the Vim syntax file. Since other syntax files are also out-of-date, I added these attributes (if missing) to other files as well. Note that in the other sytnax files (i.e. for Emacs, VScode and Kate), there will be other attributes missing too. I've also sorted all attributes alphabetically. Otherwise it's really hard to automate adding new attributes. And I think that it was the original intent to keep all of them ordered alphabetically. Differential Revision: https://reviews.llvm.org/D97627 --- llvm/utils/emacs/llvm-mode.el | 12 +++--- llvm/utils/kate/llvm.xml | 34 +++++++++++++++++ llvm/utils/vim/syntax/llvm.vim | 44 +++++++++++++++++----- llvm/utils/vscode/llvm/syntaxes/ll.tmLanguage.yaml | 44 +++++++++++++++++----- 4 files changed, 110 insertions(+), 24 deletions(-) diff --git a/llvm/utils/emacs/llvm-mode.el b/llvm/utils/emacs/llvm-mode.el index bc24b12..80ca930 100644 --- a/llvm/utils/emacs/llvm-mode.el +++ b/llvm/utils/emacs/llvm-mode.el @@ -22,12 +22,12 @@ (list ;; Attributes `(,(regexp-opt - '("alwaysinline" "argmemonly" "builtin" "cold" "convergent" "inaccessiblememonly" - "inaccessiblemem_or_argmemonly" "inlinehint" "jumptable" "minsize" "mustprogress" "naked" "nobuiltin" - "noduplicate" "nofree" "noimplicitfloat" "noinline" "nonlazybind" "noredzone" "noreturn" - "norecurse" "noundef" "nounwind" "optnone" "optsize" "readnone" "readonly" "returns_twice" - "speculatable" "ssp" "sspreq" "sspstrong" "safestack" "sanitize_address" "sanitize_hwaddress" "sanitize_memtag" - "sanitize_thread" "sanitize_memory" "strictfp" "uwtable" "willreturn" "writeonly" "immarg") 'symbols) . font-lock-constant-face) + '("alwaysinline" "argmemonly" "allocsize" "builtin" "cold" "convergent" "dereferenceable_or_null" "hot" "inaccessiblememonly" + "inaccessiblemem_or_argmemonly" "inalloca" "inlinehint" "jumptable" "minsize" "mustprogress" "naked" "nobuiltin" + "nocallback" "nocf_check" "noduplicate" "nofree" "noimplicitfloat" "noinline" "nomerge" "nonlazybind" "noprofile" "noredzone" "noreturn" + "norecurse" "nosync" "noundef" "nounwind" "null_pointer_is_valid" "optforfuzzing" "optnone" "optsize" "preallocated" "readnone" "readonly" "returns_twice" + "shadowcallstack" "speculatable" "speculative_load_hardening" "ssp" "sspreq" "sspstrong" "safestack" "sanitize_address" "sanitize_hwaddress" "sanitize_memtag" + "sanitize_thread" "sanitize_memory" "strictfp" "swifterror" "uwtable" "willreturn" "writeonly" "immarg") 'symbols) . font-lock-constant-face) ;; Variables '("%[-a-zA-Z$._][-a-zA-Z$._0-9]*" . font-lock-variable-name-face) ;; Labels diff --git a/llvm/utils/kate/llvm.xml b/llvm/utils/kate/llvm.xml index e5fd7484..9f7ec77 100644 --- a/llvm/utils/kate/llvm.xml +++ b/llvm/utils/kate/llvm.xml @@ -77,25 +77,59 @@ alignstack + allocsize alwaysinline argmemonly + arm_aapcscc + catch + cold convergent + dereferenceable_or_null + extern_weak + hhvmcc + hot + inaccessiblemem_or_argmemonly + inaccessiblememonly + inalloca inlinehint + inteldialect + jumptable + local_unnamed_addr mustprogress naked nobuiltin + nocallback + nocf_check + noduplicate + nofree noimplicitfloat noinline + nomerge + noprofile noredzone noreturn + nosync nounwind + null_pointer_is_valid + optforfuzzing optnone optsize + preallocated readnone readonly + safestack + sanitize_hwaddress + sanitize_memtag + shadowcallstack + speculative_load_hardening ssp sspreq sspstrong + swifterror + syncscope + tailcc + willreturn + willreturn addrspace diff --git a/llvm/utils/vim/syntax/llvm.vim b/llvm/utils/vim/syntax/llvm.vim index 9277eeb..48d3daf 100644 --- a/llvm/utils/vim/syntax/llvm.vim +++ b/llvm/utils/vim/syntax/llvm.vim @@ -44,11 +44,12 @@ syn keyword llvmKeyword \ alias \ align \ alignstack + \ allocsize \ alwaysinline \ appending \ argmemonly - \ arm_aapcscc \ arm_aapcs_vfpcc + \ arm_aapcscc \ arm_apcscc \ asm \ atomic @@ -58,51 +59,58 @@ syn keyword llvmKeyword \ byref \ byval \ c - \ catch \ caller + \ catch \ cc \ ccc \ cleanup + \ cold \ coldcc \ comdat \ common \ constant + \ convergent \ datalayout \ declare \ default \ define \ deplibs \ dereferenceable + \ dereferenceable_or_null \ distinct \ dllexport \ dllimport \ dso_local \ dso_preemptable \ except + \ extern_weak \ external \ externally_initialized - \ extern_weak \ fastcc - \ tailcc \ filter \ from \ gc \ global - \ hhvmcc \ hhvm_ccc + \ hhvmcc \ hidden + \ hot \ immarg + \ inaccessiblemem_or_argmemonly + \ inaccessiblememonly + \ inalloca \ initialexec \ inlinehint \ inreg - \ inteldialect \ intel_ocl_bicc + \ inteldialect \ internal + \ jumptable \ linkonce \ linkonce_odr + \ local_unnamed_addr \ localdynamic \ localexec - \ local_unnamed_addr \ minsize \ module \ monotonic @@ -113,19 +121,29 @@ syn keyword llvmKeyword \ nest \ noalias \ nobuiltin + \ nocallback \ nocapture + \ nocf_check + \ noduplicate + \ nofree \ noimplicitfloat \ noinline + \ nomerge \ nonlazybind \ nonnull + \ noprofile \ norecurse \ noredzone \ noreturn + \ nosync \ noundef \ nounwind + \ null_pointer_is_valid + \ optforfuzzing \ optnone \ optsize \ personality + \ preallocated \ private \ protected \ ptx_device @@ -135,16 +153,20 @@ syn keyword llvmKeyword \ release \ returned \ returns_twice + \ safestack \ sanitize_address + \ sanitize_hwaddress \ sanitize_memory + \ sanitize_memtag \ sanitize_thread \ section \ seq_cst + \ shadowcallstack \ sideeffect \ signext - \ syncscope \ source_filename \ speculatable + \ speculative_load_hardening \ spir_func \ spir_kernel \ sret @@ -153,8 +175,11 @@ syn keyword llvmKeyword \ sspstrong \ strictfp \ swiftcc + \ swifterror \ swiftself + \ syncscope \ tail + \ tailcc \ target \ thread_local \ to @@ -167,10 +192,11 @@ syn keyword llvmKeyword \ volatile \ weak \ weak_odr + \ willreturn + \ win64cc \ within \ writeonly \ x86_64_sysvcc - \ win64cc \ x86_fastcallcc \ x86_stdcallcc \ x86_thiscallcc diff --git a/llvm/utils/vscode/llvm/syntaxes/ll.tmLanguage.yaml b/llvm/utils/vscode/llvm/syntaxes/ll.tmLanguage.yaml index ddb1ea5..ff6707b 100644 --- a/llvm/utils/vscode/llvm/syntaxes/ll.tmLanguage.yaml +++ b/llvm/utils/vscode/llvm/syntaxes/ll.tmLanguage.yaml @@ -143,11 +143,12 @@ patterns: \\balias\\b|\ \\balign\\b|\ \\balignstack\\b|\ + \\ballocsize\\b|\ \\balwaysinline\\b|\ \\bappending\\b|\ \\bargmemonly\\b|\ - \\barm_aapcscc\\b|\ \\barm_aapcs_vfpcc\\b|\ + \\barm_aapcscc\\b|\ \\barm_apcscc\\b|\ \\basm\\b|\ \\batomic\\b|\ @@ -157,51 +158,58 @@ patterns: \\bbyref\\b|\ \\bbyval\\b|\ \\bc\\b|\ - \\bcatch\\b|\ \\bcaller\\b|\ + \\bcatch\\b|\ \\bcc\\b|\ \\bccc\\b|\ \\bcleanup\\b|\ + \\bcold\\b|\ \\bcoldcc\\b|\ \\bcomdat\\b|\ \\bcommon\\b|\ \\bconstant\\b|\ + \\bconvergent\\b|\ \\bdatalayout\\b|\ \\bdeclare\\b|\ \\bdefault\\b|\ \\bdefine\\b|\ \\bdeplibs\\b|\ \\bdereferenceable\\b|\ + \\bdereferenceable_or_null\\b|\ \\bdistinct\\b|\ \\bdllexport\\b|\ \\bdllimport\\b|\ \\bdso_local\\b|\ \\bdso_preemptable\\b|\ \\bexcept\\b|\ + \\bextern_weak\\b|\ \\bexternal\\b|\ \\bexternally_initialized\\b|\ - \\bextern_weak\\b|\ \\bfastcc\\b|\ - \\btailcc\\b|\ \\bfilter\\b|\ \\bfrom\\b|\ \\bgc\\b|\ \\bglobal\\b|\ - \\bhhvmcc\\b|\ \\bhhvm_ccc\\b|\ + \\bhhvmcc\\b|\ \\bhidden\\b|\ + \\bhot\\b|\ \\bimmarg\\b|\ + \\binaccessiblemem_or_argmemonly\\b|\ + \\binaccessiblememonly\\b|\ + \\binalloc\\b|\ \\binitialexec\\b|\ \\binlinehint\\b|\ \\binreg\\b|\ - \\binteldialect\\b|\ \\bintel_ocl_bicc\\b|\ + \\binteldialect\\b|\ \\binternal\\b|\ + \\bjumptable\\b|\ \\blinkonce\\b|\ \\blinkonce_odr\\b|\ + \\blocal_unnamed_addr\\b|\ \\blocaldynamic\\b|\ \\blocalexec\\b|\ - \\blocal_unnamed_addr\\b|\ \\bminsize\\b|\ \\bmodule\\b|\ \\bmonotonic\\b|\ @@ -212,19 +220,29 @@ patterns: \\bnest\\b|\ \\bnoalias\\b|\ \\bnobuiltin\\b|\ + \\bnocallback\\b|\ \\bnocapture\\b|\ + \\bnocf_check\\b|\ + \\bnoduplicate\\b|\ + \\bnofree\\b|\ \\bnoimplicitfloat\\b|\ \\bnoinline\\b|\ + \\bnomerge\\b|\ \\bnonlazybind\\b|\ \\bnonnull\\b|\ + \\bnoprofile\\b|\ \\bnorecurse\\b|\ \\bnoredzone\\b|\ \\bnoreturn\\b|\ + \\bnosync\\b|\ \\bnoundef\\b|\ \\bnounwind\\b|\ + \\bnull_pointer_is_valid\\b|\ + \\boptforfuzzing\\b|\ \\boptnone\\b|\ \\boptsize\\b|\ \\bpersonality\\b|\ + \\bpreallocated\\b|\ \\bprivate\\b|\ \\bprotected\\b|\ \\bptx_device\\b|\ @@ -234,16 +252,20 @@ patterns: \\brelease\\b|\ \\breturned\\b|\ \\breturns_twice\\b|\ + \\bsafestack\\b|\ \\bsanitize_address\\b|\ + \\bsanitize_hwaddress\\b|\ \\bsanitize_memory\\b|\ + \\bsanitize_memtag\\b|\ \\bsanitize_thread\\b|\ \\bsection\\b|\ \\bseq_cst\\b|\ + \\bshadowcallstack\\b|\ \\bsideeffect\\b|\ \\bsignext\\b|\ - \\bsyncscope\\b|\ \\bsource_filename\\b|\ \\bspeculatable\\b|\ + \\bspeculative_load_hardening\\b|\ \\bspir_func\\b|\ \\bspir_kernel\\b|\ \\bsret\\b|\ @@ -252,8 +274,11 @@ patterns: \\bsspstrong\\b|\ \\bstrictfp\\b|\ \\bswiftcc\\b|\ + \\bswifterror\\b|\ \\bswiftself\\b|\ + \\bsyncscope\\b|\ \\btail\\b|\ + \\btailcc\\b|\ \\btarget\\b|\ \\bthread_local\\b|\ \\bto\\b|\ @@ -266,10 +291,11 @@ patterns: \\bvolatile\\b|\ \\bweak\\b|\ \\bweak_odr\\b|\ + \\bwillreturn\\b|\ + \\bwin64cc\\b|\ \\bwithin\\b|\ \\bwriteonly\\b|\ \\bx86_64_sysvcc\\b|\ - \\bwin64cc\\b|\ \\bx86_fastcallcc\\b|\ \\bx86_stdcallcc\\b|\ \\bx86_thiscallcc\\b|\ -- 2.7.4