diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-05-30 00:08:05 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-05-30 00:08:05 +0000 |
commit | 4fe0c8e9c76b96e7aff21696a40dacc09d0237bc (patch) | |
tree | 1b4253035fcbb699c4110f220609fc7f37e64ca0 /lib/Sema/SemaDecl.cpp | |
parent | 9e8a72291465488e734c8aa5e20142d8b3cd981c (diff) |
Refactor and clean up the AST printer, so that it uses a DeclVisitor,
walks through DeclContexts properly, and prints more of the
information available in the AST. The functionality is still available
via -ast-print, -ast-dump, etc., and also via the new member functions
Decl::dump() and Decl::print().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72597 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 8375a68507..562b2dab05 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -4416,6 +4416,8 @@ Sema::DeclPtrTy Sema::ActOnFileScopeAsmDecl(SourceLocation Loc, ExprArg expr) { StringLiteral *AsmString = cast<StringLiteral>(expr.takeAs<Expr>()); - return DeclPtrTy::make(FileScopeAsmDecl::Create(Context, CurContext, - Loc, AsmString)); + FileScopeAsmDecl *New = FileScopeAsmDecl::Create(Context, CurContext, + Loc, AsmString); + CurContext->addDecl(Context, New); + return DeclPtrTy::make(New); } |