Home | History | Annotate | Download | only in blink_gc_plugin
      1 // Copyright 2015 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #include "CollectVisitor.h"
      6 
      7 #include "Config.h"
      8 
      9 using namespace clang;
     10 
     11 CollectVisitor::CollectVisitor() {
     12 }
     13 
     14 CollectVisitor::RecordVector& CollectVisitor::record_decls() {
     15   return record_decls_;
     16 }
     17 
     18 CollectVisitor::MethodVector& CollectVisitor::trace_decls() {
     19   return trace_decls_;
     20 }
     21 
     22 bool CollectVisitor::VisitCXXRecordDecl(CXXRecordDecl* record) {
     23   if (record->hasDefinition() && record->isCompleteDefinition())
     24     record_decls_.push_back(record);
     25   return true;
     26 }
     27 
     28 bool CollectVisitor::VisitCXXMethodDecl(CXXMethodDecl* method) {
     29   if (method->isThisDeclarationADefinition() && Config::IsTraceMethod(method))
     30     trace_decls_.push_back(method);
     31   return true;
     32 }
     33