QCORASTConsumer.cpp 652 Bytes
Newer Older
1
#include "QCORASTConsumer.hpp"
2
#include "LambdaVisitor.hpp"
3
4
5
6
7
8
#include <chrono>

// #include "clang/ASTMatchers/ASTMatchFinder.h"
// #include "clang/ASTMatchers/ASTMatchers.h"

// using namespace clang::ast_matchers;
9
10
11
12
13

using namespace clang;

namespace qcor {
namespace compiler {
14
QCORASTConsumer::QCORASTConsumer(CompilerInstance &c, Rewriter &rw)
15
    : ci(c),
16
      rewriter(rw) {}
17
18

bool QCORASTConsumer::HandleTopLevelDecl(DeclGroupRef DR) {
19
  LambdaVisitor visitor(ci, rewriter);
20
  for (DeclGroupRef::iterator b = DR.begin(), e = DR.end(); b != e; ++b) {
21
      visitor.TraverseDecl(*b);
22
23
24
25
26
  }
  return true;
}
} // namespace compiler
} // namespace qcor