[Clang][AST] Print attributes of Obj-C interfaces
When pretty printing an Objective-C interface declaration, Clang previously didn't print any attributes that are applied to the declaration.
This commit is contained in:
parent
b4e0890458
commit
a8eb2f0dab
@ -1517,6 +1517,11 @@ void DeclPrinter::VisitObjCInterfaceDecl(ObjCInterfaceDecl *OID) {
|
||||
return;
|
||||
}
|
||||
bool eolnOut = false;
|
||||
if (OID->hasAttrs()) {
|
||||
prettyPrintAttributes(OID);
|
||||
Out << "\n";
|
||||
}
|
||||
|
||||
Out << "@interface " << I;
|
||||
|
||||
if (auto TypeParams = OID->getTypeParamListAsWritten()) {
|
||||
|
||||
@ -21,6 +21,10 @@
|
||||
- (void)methodWithArg:(int)x andAnotherOne:(int)y { }
|
||||
@end
|
||||
|
||||
__attribute__((availability(macosx,introduced=10.1.0,deprecated=10.2)))
|
||||
@interface InterfaceWithAttribute
|
||||
@end
|
||||
|
||||
// CHECK: @protocol P
|
||||
// CHECK: - (void)MethP __attribute__((availability(macos, introduced=10.1.0, deprecated=10.2)));
|
||||
// CHECK: @end
|
||||
@ -45,6 +49,10 @@
|
||||
|
||||
// CHECK: @end
|
||||
|
||||
// CHECK: __attribute__((availability(macos, introduced=10.1.0, deprecated=10.2)))
|
||||
// CHECK: @interface InterfaceWithAttribute
|
||||
// CHECK: @end
|
||||
|
||||
@class C1;
|
||||
struct __attribute__((objc_bridge_related(C1,,))) S1;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user