summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTConsumer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/AST/ASTConsumer.cpp')
-rw-r--r--clang/lib/AST/ASTConsumer.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/clang/lib/AST/ASTConsumer.cpp b/clang/lib/AST/ASTConsumer.cpp
new file mode 100644
index 00000000000..b3d12710927
--- /dev/null
+++ b/clang/lib/AST/ASTConsumer.cpp
@@ -0,0 +1,28 @@
+//===--- ASTConsumer.cpp - Abstract interface for reading ASTs --*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file 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;
+
+ASTConsumer::~ASTConsumer() {}
+
+void ASTConsumer::HandleTopLevelDeclaration(Decl* d) {
+ if (ScopedDecl* sd = dyn_cast<ScopedDecl>(d))
+ while (sd) {
+ HandleTopLevelDecl(sd);
+ sd = sd->getNextDeclarator();
+ }
+ else
+ HandleTopLevelDecl(d);
+}
OpenPOWER on IntegriCloud