| 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 #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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |