Skip to content
Commit 4be8a269 authored by Aaron Ballman's avatar Aaron Ballman
Browse files

Use tablegen to diagnose mutually exclusive attributes

Currently, when one or more attributes are mutually exclusive, the
developer adding the attribute has to manually emit diagnostics. In
practice, this is highly error prone, especially for declaration
attributes, because such checking is not trivial. Redeclarations
require you to write a "merge" function to diagnose mutually exclusive
attributes and most attributes get this wrong.

This patch introduces a table-generated way to specify that a group of
two or more attributes are mutually exclusive:

def : MutualExclusions<[Attr1, Attr2, Attr3]>;

This works for both statement and declaration attributes (but not type
attributes) and the checking is done either from the common attribute
diagnostic checking code or from within mergeDeclAttribute() when
merging redeclarations.
parent f02c6984
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment