| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "Config.h" | 5 #include "Config.h" |
| 6 #include "RecordInfo.h" | 6 #include "RecordInfo.h" |
| 7 | 7 |
| 8 using namespace clang; | 8 using namespace clang; |
| 9 using std::string; | 9 using std::string; |
| 10 | 10 |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 it != record_->method_end(); ++it) { | 358 it != record_->method_end(); ++it) { |
| 359 if (*it == trace_method_) { | 359 if (*it == trace_method_) { |
| 360 is_declaring_local_trace_ = kTrue; | 360 is_declaring_local_trace_ = kTrue; |
| 361 break; | 361 break; |
| 362 } | 362 } |
| 363 } | 363 } |
| 364 } | 364 } |
| 365 return is_declaring_local_trace_; | 365 return is_declaring_local_trace_; |
| 366 } | 366 } |
| 367 | 367 |
| 368 bool RecordInfo::IsGCMixinInstance() { | |
| 369 assert(IsGCDerived()); | |
| 370 if (record_->isAbstract()) | |
| 371 return false; | |
| 372 | |
| 373 assert(!IsGCMixin()); | |
| 374 | |
| 375 // true iff the class derives from GCMixin and | |
| 376 // one or more other GC base classes. | |
| 377 bool seen_gc_mixin = false; | |
| 378 bool seen_gc_derived = false; | |
| 379 for (const auto& gc_base : gc_base_names_) { | |
| 380 if (Config::IsGCMixinBase(gc_base)) | |
| 381 seen_gc_mixin = true; | |
| 382 else if (Config::IsGCBase(gc_base)) | |
| 383 seen_gc_derived = true; | |
| 384 } | |
| 385 return seen_gc_derived && seen_gc_mixin; | |
| 386 } | |
| 387 | |
| 388 // A (non-virtual) class is considered abstract in Blink if it has | 368 // A (non-virtual) class is considered abstract in Blink if it has |
| 389 // no public constructors and no create methods. | 369 // no public constructors and no create methods. |
| 390 bool RecordInfo::IsConsideredAbstract() { | 370 bool RecordInfo::IsConsideredAbstract() { |
| 391 for (CXXRecordDecl::ctor_iterator it = record_->ctor_begin(); | 371 for (CXXRecordDecl::ctor_iterator it = record_->ctor_begin(); |
| 392 it != record_->ctor_end(); | 372 it != record_->ctor_end(); |
| 393 ++it) { | 373 ++it) { |
| 394 if (!it->isCopyOrMoveConstructor() && it->getAccess() == AS_public) | 374 if (!it->isCopyOrMoveConstructor() && it->getAccess() == AS_public) |
| 395 return false; | 375 return false; |
| 396 } | 376 } |
| 397 for (CXXRecordDecl::method_iterator it = record_->method_begin(); | 377 for (CXXRecordDecl::method_iterator it = record_->method_begin(); |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 674 edge->members().push_back(member); | 654 edge->members().push_back(member); |
| 675 } | 655 } |
| 676 // TODO: Handle the case where we fail to create an edge (eg, if the | 656 // TODO: Handle the case where we fail to create an edge (eg, if the |
| 677 // argument is a primitive type or just not fully known yet). | 657 // argument is a primitive type or just not fully known yet). |
| 678 } | 658 } |
| 679 return edge; | 659 return edge; |
| 680 } | 660 } |
| 681 | 661 |
| 682 return new Value(info); | 662 return new Value(info); |
| 683 } | 663 } |
| OLD | NEW |