This patch allows pushing an empty #pragma clang attribute push, then adding multiple attributes to it, then popping them all with #pragma clang attribute pop, just like #pragma clang diagnostic. We still support the current way of adding these, #pragma clang attribute push(__attribute__((...))), by treating it like a combined push/attribute. This is needed to create macros that behave like:
DO_SOMETHING_BEGIN(attr1, attr2, attr3) // ... DO_SOMETHING_END
Which can be called with a variable number of arguments. One possible alternative would be to allow multiple attributes to be specified in the combined push operation, but I chose this method to be more consistent with #pragma clang diagnostic.
Fixes rdar://45496947.
Thanks for taking a look!
Erik