aboutsummaryrefslogtreecommitdiff
path: root/AST/ASTConsumer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'AST/ASTConsumer.cpp')
-rw-r--r--AST/ASTConsumer.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/AST/ASTConsumer.cpp b/AST/ASTConsumer.cpp
new file mode 100644
index 0000000000..0cf614102d
--- /dev/null
+++ b/AST/ASTConsumer.cpp
@@ -0,0 +1,27 @@
+//===--- ASTConsumer.cpp - Abstract interface for reading ASTs --*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file was developed by Ted Kremenek and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines the ASTConsumer class.
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/AST/ASTConsumer.h"
+#include "clang/AST/Decl.h"
+
+using namespace clang;
+
+void ASTConsumer::HandleTopLevelDeclaration(Decl* d) {
+ if (ScopedDecl* sd = dyn_cast<ScopedDecl>(d))
+ while (sd) {
+ HandleTopLevelDecl(sd);
+ sd = sd->getNextDeclarator();
+ }
+ else
+ HandleTopLevelDecl(d);
+}