[PATCH] consumable attribute default state
David Blaikie
dblaikie at gmail.com
Wed Sep 4 13:40:33 PDT 2013
>> > + if (Param == "unknown") {
>> > + DefaultState = ConsumableAttr::Unknown;
>> > + } else if (Param == "consumed") {
>> > + DefaultState = ConsumableAttr::Consumed;
>> > + } else if (Param == "unconsumed") {
>> > + DefaultState = ConsumableAttr::Unconsumed;
>> > + } else {
>> > + S.Diag(Attr.getLoc(), diag::warn_unknown_consumed_state) <<
>> > Param;
>> > + return;
>> > + }
An llvm::StringSwitch might be applicable here (not sure how
conveniently it'll handle your 'else' case, but it might work).
More information about the cfe-commits
mailing list