virtual bool isLateParsed() const { return false; }
// Pretty print this attribute.
- virtual void printPretty(llvm::raw_ostream &OS, ASTContext &C) const = 0;
+ virtual void printPretty(llvm::raw_ostream &OS,
+ const PrintingPolicy &Policy) const = 0;
// Implement isa/cast/dyncast/etc.
static bool classof(const Attr *) { return true; }
if (D->hasAttrs()) {
AttrVec &Attrs = D->getAttrs();
for (AttrVec::const_iterator i=Attrs.begin(), e=Attrs.end(); i!=e; ++i) {
- Attr *A = *i;
- A->printPretty(Out, Context);
+ Attr *A = *i;
+ A->printPretty(Out, Policy);
}
}
}
first = false;
}
// TODO: check this
- (*it)->printPretty(OS, Context);
+ (*it)->printPretty(OS, Policy);
}
OS << "]] ";
PrintStmt(Node->getSubStmt(), 0);
// CHECK-LIST-NEXT: test_namespace::TheClass
// CHECK-LIST-NEXT: test_namespace::TheClass::theMethod
// CHECK-LIST-NEXT: x
+//
+// RUN: clang-check -ast-dump -ast-dump-filter test_namespace::TheClass::n "%s" -- 2>&1 | FileCheck -check-prefix CHECK-ATTR %s
+// CHECK-ATTR: test_namespace
+// CHECK-ATTR-NEXT: int n __attribute__((aligned(1 + 1
namespace test_namespace {
int theMethod(int x) {
return x + x;
}
+ int n __attribute__((aligned(1+1)));
};
}
<< "Type(), Record);\n";
}
void writeValue(raw_ostream &OS) const {
- OS << "\" << get" << getUpperName() << "(Ctx) << \"";
+ OS << "\";\n"
+ << " " << getLowerName() << "Expr->printPretty(OS, 0, Policy);\n"
+ << " OS << \"";
}
};
OS << " }\n\n";
OS << " virtual " << R.getName() << "Attr *clone (ASTContext &C) const;\n";
- OS << " virtual void printPretty(llvm::raw_ostream &OS, ASTContext &Ctx) const;\n";
+ OS << " virtual void printPretty(llvm::raw_ostream &OS,"
+ << " const PrintingPolicy &Policy) const;\n";
for (ai = Args.begin(); ai != ae; ++ai) {
(*ai)->writeAccessors(OS);
OS << ");\n}\n\n";
OS << "void " << R.getName() << "Attr::printPretty("
- << "llvm::raw_ostream &OS, ASTContext &Ctx) const {\n";
+ << "llvm::raw_ostream &OS, const PrintingPolicy &Policy) const {\n";
if (Spellings.begin() != Spellings.end()) {
std::string Spelling = (*Spellings.begin())->getValueAsString("Name");
OS << " OS << \" __attribute__((" << Spelling;