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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 } else if (it->getNumParams() == 2) { | 223 } else if (it->getNumParams() == 2) { |
224 placement = !it->isDeleted(); | 224 placement = !it->isDeleted(); |
225 } | 225 } |
226 } | 226 } |
227 } | 227 } |
228 is_only_placement_newable_ = (placement && new_deleted) ? kTrue : kFalse; | 228 is_only_placement_newable_ = (placement && new_deleted) ? kTrue : kFalse; |
229 } | 229 } |
230 return is_only_placement_newable_; | 230 return is_only_placement_newable_; |
231 } | 231 } |
232 | 232 |
| 233 CXXMethodDecl* RecordInfo::DeclaresNewOperator() { |
| 234 for (CXXRecordDecl::method_iterator it = record_->method_begin(); |
| 235 it != record_->method_end(); |
| 236 ++it) { |
| 237 if (it->getNameAsString() == kNewOperatorName && it->getNumParams() == 1) |
| 238 return *it; |
| 239 } |
| 240 return 0; |
| 241 } |
| 242 |
233 // An object requires a tracing method if it has any fields that need tracing. | 243 // An object requires a tracing method if it has any fields that need tracing. |
234 bool RecordInfo::RequiresTraceMethod() { | 244 bool RecordInfo::RequiresTraceMethod() { |
235 if (IsStackAllocated()) | 245 if (IsStackAllocated()) |
236 return false; | 246 return false; |
237 GetFields(); | 247 GetFields(); |
238 return fields_need_tracing_.IsNeeded(); | 248 return fields_need_tracing_.IsNeeded(); |
239 } | 249 } |
240 | 250 |
241 // Get the actual tracing method (ie, can be traceAfterDispatch if there is a | 251 // Get the actual tracing method (ie, can be traceAfterDispatch if there is a |
242 // dispatch method). | 252 // dispatch method). |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 edge->members().push_back(member); | 516 edge->members().push_back(member); |
507 } | 517 } |
508 // TODO: Handle the case where we fail to create an edge (eg, if the | 518 // TODO: Handle the case where we fail to create an edge (eg, if the |
509 // argument is a primitive type or just not fully known yet). | 519 // argument is a primitive type or just not fully known yet). |
510 } | 520 } |
511 return edge; | 521 return edge; |
512 } | 522 } |
513 | 523 |
514 return new Value(info); | 524 return new Value(info); |
515 } | 525 } |
OLD | NEW |