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

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

Issue 2536403002: blink_gc_plugin should require tracing for classes that have a trace method
Patch Set: Created 4 years 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
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 #include "clang/Sema/Sema.h" 7 #include "clang/Sema/Sema.h"
8 8
9 using namespace clang; 9 using namespace clang;
10 using std::string; 10 using std::string;
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 if (IsStackAllocated()) 280 if (IsStackAllocated())
281 return false; 281 return false;
282 unsigned bases_with_trace = 0; 282 unsigned bases_with_trace = 0;
283 for (Bases::iterator it = GetBases().begin(); it != GetBases().end(); ++it) { 283 for (Bases::iterator it = GetBases().begin(); it != GetBases().end(); ++it) {
284 if (it->second.NeedsTracing().IsNeeded()) 284 if (it->second.NeedsTracing().IsNeeded())
285 ++bases_with_trace; 285 ++bases_with_trace;
286 } 286 }
287 if (bases_with_trace > 1) 287 if (bases_with_trace > 1)
288 return true; 288 return true;
289 GetFields(); 289 GetFields();
290 return fields_need_tracing_.IsNeeded(); 290 return fields_need_tracing_.IsNeeded() || GetTraceMethod();
291 } 291 }
292 292
293 // Get the actual tracing method (ie, can be traceAfterDispatch if there is a 293 // Get the actual tracing method (ie, can be traceAfterDispatch if there is a
294 // dispatch method). 294 // dispatch method).
295 CXXMethodDecl* RecordInfo::GetTraceMethod() { 295 CXXMethodDecl* RecordInfo::GetTraceMethod() {
296 DetermineTracingMethods(); 296 DetermineTracingMethods();
297 return trace_method_; 297 return trace_method_;
298 } 298 }
299 299
300 // Get the static trace dispatch method. 300 // Get the static trace dispatch method.
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 edge->members().push_back(member); 655 edge->members().push_back(member);
656 } 656 }
657 // TODO: Handle the case where we fail to create an edge (eg, if the 657 // TODO: Handle the case where we fail to create an edge (eg, if the
658 // argument is a primitive type or just not fully known yet). 658 // argument is a primitive type or just not fully known yet).
659 } 659 }
660 return edge; 660 return edge;
661 } 661 }
662 662
663 return new Value(info); 663 return new Value(info);
664 } 664 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698