Ted Kremenek | 2ff3e69 | 2007-11-29 23:05:17 +0000 | [diff] [blame] | 1 | //===--- ASTConsumer.cpp - Abstract interface for reading ASTs --*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file was developed by Ted Kremenek and is distributed under |
| 6 | // the University of Illinois Open Source License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file defines the ASTConsumer class. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #include "clang/AST/ASTConsumer.h" |
| 15 | #include "clang/AST/Decl.h" |
| 16 | |
| 17 | using namespace clang; |
| 18 | |
| 19 | void ASTConsumer::HandleTopLevelDeclaration(Decl* d) { |
| 20 | if (ScopedDecl* sd = dyn_cast<ScopedDecl>(d)) |
| 21 | while (sd) { |
| 22 | HandleTopLevelDecl(sd); |
| 23 | sd = sd->getNextDeclarator(); |
| 24 | } |
| 25 | else |
| 26 | HandleTopLevelDecl(d); |
| 27 | } |