<div dir="ltr">Hi,<div><br></div><div>I would like to propose a new Clang pragma that would apply a specified attribute to some specific declarations in a source file. Initially the pragma would only work with annotation-like attributes that explicitly opt-in into allowing this pragma. This will ensure that this pragma can avoid conflicts with other pragmas that apply attributes like "#pragma clang optimize off", etc. The set of declarations that receive the attribute would be attribute-specific. </div><div><br></div><div>I would like to propose the following syntax:</div><div><br></div><div>    #pragma clang attribute push(annotate("important"<wbr>)) // or maybe push(__attribute__(annotate("important")))?</div><div><br></div><div>    void foo(); // This function will now have the annotate("important") attribute.</div><div><br></div><div>    #pragma clang attribute pop</div><div><br></div><div>We would like to use this pragma to apply the new 'external_source_attribute' (<a href="https://reviews.llvm.org/D29819" rel="noreferrer" target="_blank" style="font-size:12.800000190734863px">https://reviews.llvm.org/<wbr>D29819</a>) to all of the declarations in an Objective-C header file that was auto-generated by the Swift compiler without adding additional attribute/macro to each declaration.</div><div><br></div><div>Do you have any thoughts / suggestions about this proposal?</div><div><br></div><div>Cheers,</div><div>Alex</div></div>