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 CollectVisitor()11CollectVisitor::CollectVisitor() { 12 } 13 record_decls()14CollectVisitor::RecordVector& CollectVisitor::record_decls() { 15 return record_decls_; 16 } 17 trace_decls()18CollectVisitor::MethodVector& CollectVisitor::trace_decls() { 19 return trace_decls_; 20 } 21 VisitCXXRecordDecl(CXXRecordDecl * record)22bool CollectVisitor::VisitCXXRecordDecl(CXXRecordDecl* record) { 23 if (record->hasDefinition() && record->isCompleteDefinition()) 24 record_decls_.push_back(record); 25 return true; 26 } 27 VisitCXXMethodDecl(CXXMethodDecl * method)28bool CollectVisitor::VisitCXXMethodDecl(CXXMethodDecl* method) { 29 if (method->isThisDeclarationADefinition()) { 30 if (Config::IsTraceMethod(method)) { 31 trace_decls_.push_back(method); 32 } 33 } 34 return true; 35 } 36