TableGen warning groups: overlapping groups?

Right now in Diagnostics.td we have:

// Anything that can be controlled by an option subclasses this.
class OptionControlled;

class DiagnosticControlled<string text, string defaultMapping>
   : Diagnostic<text>, OptionControlled { ... }

class Warning<string text> : DiagnosticControlled<text, "warning"> {}
...

class Option<string name, list<OptionControlled> members> : OptionControlled {
   ....
   list<OptionControlled> Members = members;
}

Since a warning can belong to multiple Options, what are the semantics when one Option containing a DiagnosticControlled is enabled and another disabled? Moreover, since Option also subclasses OptionControlled, conceivably it can belong to the list<OptionControlled> of another option. I'm assuming this basically means "inline the DiagnosticControlled" values of the included Option, but the first question applies in spades to this case as well.

I'm only bringing this up because it seems like a really critical detail of the Diagnostic data model.

Since a warning can belong to multiple Options, what are the semantics
when one Option containing a DiagnosticControlled is enabled and
another disabled?

The frontend goes through the options in command line order and enables and
disables the individual warnings as it comes across the options. Thus,
later options override the choice made by earlier options.
This allows the user to enable a large group of warnings, and then
selectively disable smaller groups or individual warnings.

Moreover, since Option also subclasses
OptionControlled, conceivably it can belong to the
list<OptionControlled> of another option. I'm assuming this basically
means "inline the DiagnosticControlled" values of the included Option,

Yes.

Sebastian

I think this is exactly the behavior that we want.

  - Doug

Great. This allows users to specify a clear total ordering between flipping options on and off.