Clang Blank Attributes?

Let me first explain my situation.
I'm developing a CFE-based tool called
mutator( for the time being,
mutator does some static checks(Misra-C:2004 and
SaferCPP: and some
automatic refactoring (mainly SaferCPP).
mutator needs to have some sort of an options to let the users turn
off diagnostics or automatic-refactoring for some parts of the code.
And for that we need custom attributes.

The thing with is, according to this
there is no other of way doing that other than modifying clang source
code which causes all sorts of trouble with mutator's CI and the final

I do not expect my patches to and SemaDeclAttr.cpp to get
accepted since they're dead code to anything other than mutator so it
got me thinking.

Would it be useful to add some blank custom attributes to clang that
lets other similar tools use them as they see fit in MatchFinder
Roughly like:

def BlankAttr01 : InheritableAttr {

let Spellings = [CXX11<"clang", "blank_01">];
let Subjects = SubjectList<[Var, Function, CXXRecord]>;
let Documentation = [Undocumented];
let Args = [BooleanArgument<"__bool01">];

case AttributeList::AT_BlankAttr01:
  handleSimpleAttribute<BlankAttr01Attr>(S, D, Attr);

This way there are some blank attributes that can be used by tools(not
in sema of course. my main point is for them to be used in matcher
callbacks.) without having to modify clang source code.

Thoughts? Suggestions?

I don't think we'd want to go with a blank attribute. However, we do
have an existing generic attribute (the annotate attribute), and we
have some patches towards pluggable attributes, if you wanted to put
in the effort to clean them up (I can send you the list if that's
something you'd be interested in working on).


Sure, i want to help.

Sure, i want to help.

The original author of these patches is unable to shepard them through
the process right now, but did post them for anyone who'd like to pick
them up: Use virtual functions in
ParsedAttrInfo instead of function pointers Move ParsedAttrInfos into a registry
and point to one in AttributeList Move things from
AttrParserStringSwitches into ParsedAttrInfo Get rid of
and instead put the index in ParsedAttrInfo Get rid of
SpellingIndexToSemanticSpelling and instead use ParsedAttrInfo Add ParsedAttrInfo::handleDeclAttribute Add an attribute plugin example

For some reference on the topic, see this thread (I've started it from
where there was a high-level design discussion of pluggable
These patches don't follow that exact design, but are likely close
enough to work as a great starting point.

I'm happy to be a reviewer on any patches you produce.