Implement an AST pretty-printer for declarations, under -print-ast.

Swift SVN r3431
This commit is contained in:
Doug Gregor
2012-12-10 23:21:49 +00:00
parent b4ca0f1fef
commit f3857df469
9 changed files with 696 additions and 10 deletions

View File

@@ -34,6 +34,7 @@ namespace swift {
class ExtensionDecl;
class OneOfElementDecl;
class NameAliasType;
struct PrintOptions;
class TupleType;
class Type;
class TypeAliasDecl;
@@ -204,7 +205,19 @@ public:
void clearLookupCache();
void dump() const;
/// \brief Pretty-print the entire contents of this translation unit.
///
/// \param os The stream to which the contents will be printed.
void print(raw_ostream &os);
/// \brief Pretty-print the contents of this translation unit.
///
/// \param os The stream to which the contents will be printed.
///
/// \param options Options controlling the printing process.
void print(raw_ostream &os, const PrintOptions &options);
static bool classof(const DeclContext *DC) {
return DC->getContextKind() == DeclContextKind::TranslationUnit;
}