Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(621)

Side by Side Diff: tools/clang/blink_gc_plugin/RecordInfo.cpp

Issue 261973002: Blink GC plugin: require that GC derived classes do not override their new(size_t) operator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: only check new(size_t) Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « tools/clang/blink_gc_plugin/RecordInfo.h ('k') | tools/clang/blink_gc_plugin/tests/class_overrides_new.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698