| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 it != base_paths_->end(); | 108 it != base_paths_->end(); |
| 109 ++it) { | 109 ++it) { |
| 110 const CXXBasePathElement& elem = (*it)[it->size() - 1]; | 110 const CXXBasePathElement& elem = (*it)[it->size() - 1]; |
| 111 CXXRecordDecl* base = elem.Base->getType()->getAsCXXRecordDecl(); | 111 CXXRecordDecl* base = elem.Base->getType()->getAsCXXRecordDecl(); |
| 112 if (Config::IsGCFinalizedBase(base->getName())) | 112 if (Config::IsGCFinalizedBase(base->getName())) |
| 113 return true; | 113 return true; |
| 114 } | 114 } |
| 115 return false; | 115 return false; |
| 116 } | 116 } |
| 117 | 117 |
| 118 bool RecordInfo::IsTreeShared() { | |
| 119 if (Config::IsTreeSharedBase(name_)) | |
| 120 return true; | |
| 121 if (!IsGCDerived()) | |
| 122 return false; | |
| 123 for (CXXBasePaths::paths_iterator it = base_paths_->begin(); | |
| 124 it != base_paths_->end(); | |
| 125 ++it) { | |
| 126 // TreeShared is an immediate base of GCFinalized. | |
| 127 if (it->size() < 2) continue; | |
| 128 const CXXBasePathElement& elem = (*it)[it->size() - 2]; | |
| 129 CXXRecordDecl* base = elem.Base->getType()->getAsCXXRecordDecl(); | |
| 130 if (Config::IsTreeSharedBase(base->getName())) | |
| 131 return true; | |
| 132 } | |
| 133 return false; | |
| 134 } | |
| 135 | |
| 136 // A GC mixin is a class that inherits from a GC mixin base and has | 118 // A GC mixin is a class that inherits from a GC mixin base and has |
| 137 // not yet been "mixed in" with another GC base class. | 119 // not yet been "mixed in" with another GC base class. |
| 138 bool RecordInfo::IsGCMixin() { | 120 bool RecordInfo::IsGCMixin() { |
| 139 if (!IsGCDerived() || base_paths_->begin() == base_paths_->end()) | 121 if (!IsGCDerived() || base_paths_->begin() == base_paths_->end()) |
| 140 return false; | 122 return false; |
| 141 for (CXXBasePaths::paths_iterator it = base_paths_->begin(); | 123 for (CXXBasePaths::paths_iterator it = base_paths_->begin(); |
| 142 it != base_paths_->end(); | 124 it != base_paths_->end(); |
| 143 ++it) { | 125 ++it) { |
| 144 // Get the last element of the path. | 126 // Get the last element of the path. |
| 145 const CXXBasePathElement& elem = (*it)[it->size() - 1]; | 127 const CXXBasePathElement& elem = (*it)[it->size() - 1]; |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 edge->members().push_back(member); | 506 edge->members().push_back(member); |
| 525 } | 507 } |
| 526 // TODO: Handle the case where we fail to create an edge (eg, if the | 508 // TODO: Handle the case where we fail to create an edge (eg, if the |
| 527 // argument is a primitive type or just not fully known yet). | 509 // argument is a primitive type or just not fully known yet). |
| 528 } | 510 } |
| 529 return edge; | 511 return edge; |
| 530 } | 512 } |
| 531 | 513 |
| 532 return new Value(info); | 514 return new Value(info); |
| 533 } | 515 } |
| OLD | NEW |