forked from OSchip/llvm-project
Pretty print attributes associated with record declarations.
llvm-svn: 217784
This commit is contained in:
parent
18625ee75c
commit
5388538e87
|
@ -377,6 +377,9 @@ void DeclPrinter::VisitRecordDecl(RecordDecl *D) {
|
|||
if (!Policy.SuppressSpecifiers && D->isModulePrivate())
|
||||
Out << "__module_private__ ";
|
||||
Out << D->getKindName();
|
||||
|
||||
prettyPrintAttributes(D);
|
||||
|
||||
if (D->getIdentifier())
|
||||
Out << ' ' << *D;
|
||||
|
||||
|
@ -768,6 +771,9 @@ void DeclPrinter::VisitCXXRecordDecl(CXXRecordDecl *D) {
|
|||
if (!Policy.SuppressSpecifiers && D->isModulePrivate())
|
||||
Out << "__module_private__ ";
|
||||
Out << D->getKindName();
|
||||
|
||||
prettyPrintAttributes(D);
|
||||
|
||||
if (D->getIdentifier())
|
||||
Out << ' ' << *D;
|
||||
|
||||
|
|
|
@ -42,3 +42,6 @@ int rvarr(int n, int a[restrict static n]) {
|
|||
typedef struct {
|
||||
int f;
|
||||
} T __attribute__ ((__aligned__));
|
||||
|
||||
// CHECK: struct __attribute__((visibility("default"))) S;
|
||||
struct __attribute__((visibility("default"))) S;
|
||||
|
|
|
@ -208,3 +208,8 @@ void test(int i) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace {
|
||||
// CHECK: struct {{\[\[gnu::visibility\(\"hidden\"\)\]\]}} S;
|
||||
struct [[gnu::visibility("hidden")]] S;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ int small __attribute__((mode(byte)));
|
|||
// CHECK: int v __attribute__((visibility("hidden")));
|
||||
int v __attribute__((visibility("hidden")));
|
||||
|
||||
// FIXME: The attribute should be printed with the tag declaration.
|
||||
// CHECK: class __attribute__((consumable("unknown"))) AttrTester1
|
||||
class __attribute__((consumable(unknown))) AttrTester1 {
|
||||
// CHECK: void callableWhen() __attribute__((callable_when("unconsumed", "consumed")));
|
||||
void callableWhen() __attribute__((callable_when("unconsumed", "consumed")));
|
||||
|
|
Loading…
Reference in New Issue