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 | 278f52ec29642d6a0ae40f4518e3f67387ee4cfb (patch) | |
tree | dc01edd5515e3be87e9afbd071cc8cfe8a97143f /clang/lib/Sema/SemaDecl.cpp | |
parent | 01bcef4a17131b08fd6cf8f7bdaa4b8456dd63f8 (diff) | |
download | bcm5719-llvm-278f52ec29642d6a0ae40f4518e3f67387ee4cfb.tar.gz bcm5719-llvm-278f52ec29642d6a0ae40f4518e3f67387ee4cfb.zip |
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().
llvm-svn: 72597
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 8375a68507a..562b2dab055 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/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); } |