int TestAlignedNull __attribute__((aligned));
// CHECK: VarDecl{{.*}}TestAlignedNull
-// CHECK-NEXT: AlignedAttr
+// CHECK-NEXT: AlignedAttr {{.*}} aligned
// CHECK-NEXT: <<<NULL>>>
int TestAlignedExpr __attribute__((aligned(4)));
// CHECK: VarDecl{{.*}}TestAlignedExpr
-// CHECK-NEXT: AlignedAttr
+// CHECK-NEXT: AlignedAttr {{.*}} aligned
// CHECK-NEXT: IntegerLiteral
int TestEnum __attribute__((visibility("default")));
void TestIdentifier(void *, int)
__attribute__((pointer_with_type_tag(ident1,1,2)));
// CHECK: FunctionDecl{{.*}}TestIdentifier
-// CHECK: ArgumentWithTypeTagAttr{{.*}} ident1
+// CHECK: ArgumentWithTypeTagAttr{{.*}} pointer_with_type_tag ident1
void TestBool(void *, int)
__attribute__((pointer_with_type_tag(bool1,1,2)));
// CHECK: FunctionDecl{{.*}}TestBool
-// CHECK: ArgumentWithTypeTagAttr{{.*}} IsPointer
+// CHECK: ArgumentWithTypeTagAttr{{.*}}pointer_with_type_tag bool1 0 1 IsPointer
void TestUnsigned(void *, int)
__attribute__((pointer_with_type_tag(unsigned1,1,2)));
// CHECK: FunctionDecl{{.*}}TestUnsigned
-// CHECK: ArgumentWithTypeTagAttr{{.*}} 0 1
+// CHECK: ArgumentWithTypeTagAttr{{.*}} pointer_with_type_tag unsigned1 0 1
void TestInt(void) __attribute__((constructor(123)));
// CHECK: FunctionDecl{{.*}}TestInt
if (!R.getValueAsBit("ASTNode"))
continue;
OS << " case attr::" << R.getName() << ": {\n";
+
+ // If the attribute has a semantically-meaningful name (which is determined
+ // by whether there is a Spelling enumeration for it), then write out the
+ // spelling used for the attribute.
+ std::vector<Record *> Spellings = R.getValueAsListOfDefs("Spellings");
+ if (Spellings.size() > 1 && !SpellingNamesAreCommon(Spellings))
+ OS << " OS << \" \" << A->getSpelling();\n";
+
Args = R.getValueAsListOfDefs("Args");
if (!Args.empty()) {
OS << " const " << R.getName() << "Attr *SA = cast<" << R.getName()