This is an archive of the discontinued LLVM Phabricator instance.

[Utils] Add missing attributes in syntax files
ClosedPublic

Authored by awarzynski on Feb 28 2021, 6:40 AM.

Details

Summary

[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.

Diff Detail

Event Timeline

awarzynski requested review of this revision.Feb 28 2021, 6:40 AM
awarzynski created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 28 2021, 6:40 AM
jdoerfert accepted this revision.Feb 28 2021, 8:46 AM

LG, there are others missing, would you mind adding them as well?

This revision is now accepted and ready to land.Feb 28 2021, 8:46 AM

LG, there are others missing, would you mind adding them as well?

Sure, but I see only 2 more editors not included here and:

  • Jedit has only a TableGen file (i.e. no LLVM IR syntax file)
  • Emacs has already been updated here

Ping me if there's something beyond the above ^^^ that I've missed. Otherwise I'll merge as is. Ta!

I meant attributes, not editors. So must_progress and other new ones should be included as well.

awarzynski updated this revision to Diff 328464.Mar 5 2021, 3:07 AM

Add other missing attributes

awarzynski retitled this revision from [Utils] Add 'willreturn' function attribute to syntax highlighting to [Utils] Add missing attributes in syntax files.Mar 5 2021, 3:08 AM
awarzynski edited the summary of this revision. (Show Details)

I meant attributes, not editors. So must_progress and other new ones should be included as well.

mustprogress was already there, but there were others missing. Quite a few actually. I focused on Vim - that's what I use and I understand its syntax. Tried my best to be nice to other editors too.

fhahn added a subscriber: fhahn.Mar 5 2021, 3:27 AM

Thanks for adding those!

jdoerfert accepted this revision.Mar 5 2021, 7:48 AM

Great, thanks a lot!

This revision was landed with ongoing or failed builds.Mar 5 2021, 9:36 AM
This revision was automatically updated to reflect the committed changes.