| 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 // This clang plugin checks various invariants of the Blink garbage | 5 // This clang plugin checks various invariants of the Blink garbage |
| 6 // collection infrastructure. | 6 // collection infrastructure. |
| 7 // | 7 // |
| 8 // Errors are described at: | 8 // Errors are described at: |
| 9 // http://www.chromium.org/developers/blink-gc-plugin-errors | 9 // http://www.chromium.org/developers/blink-gc-plugin-errors |
| 10 | 10 |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 it->second.MarkTraced(); | 377 it->second.MarkTraced(); |
| 378 } | 378 } |
| 379 } | 379 } |
| 380 | 380 |
| 381 QualType base = expr->getBaseType(); | 381 QualType base = expr->getBaseType(); |
| 382 if (!base->isPointerType()) | 382 if (!base->isPointerType()) |
| 383 return true; | 383 return true; |
| 384 CXXRecordDecl* decl = base->getPointeeType()->getAsCXXRecordDecl(); | 384 CXXRecordDecl* decl = base->getPointeeType()->getAsCXXRecordDecl(); |
| 385 if (decl) | 385 if (decl) |
| 386 CheckTraceFieldCall(expr->getMemberName().getAsString(), decl, arg); | 386 CheckTraceFieldCall(expr->getMemberName().getAsString(), decl, arg); |
| 387 if (expr->getMemberName().getAsString() == kTraceImplName) |
| 388 delegates_to_traceimpl_ = true; |
| 387 return true; | 389 return true; |
| 388 } | 390 } |
| 389 | 391 |
| 390 if (CXXMemberCallExpr* expr = dyn_cast<CXXMemberCallExpr>(call)) { | 392 if (CXXMemberCallExpr* expr = dyn_cast<CXXMemberCallExpr>(call)) { |
| 391 if (CheckTraceFieldCall(expr) || CheckRegisterWeakMembers(expr)) | 393 if (CheckTraceFieldCall(expr) || CheckRegisterWeakMembers(expr)) |
| 392 return true; | 394 return true; |
| 393 | 395 |
| 394 if (expr->getMethodDecl()->getNameAsString() == kTraceImplName) { | 396 if (expr->getMethodDecl()->getNameAsString() == kTraceImplName) { |
| 395 delegates_to_traceimpl_ = true; | 397 delegates_to_traceimpl_ = true; |
| 396 return true; | 398 return true; |
| (...skipping 1535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1932 | 1934 |
| 1933 private: | 1935 private: |
| 1934 BlinkGCPluginOptions options_; | 1936 BlinkGCPluginOptions options_; |
| 1935 }; | 1937 }; |
| 1936 | 1938 |
| 1937 } // namespace | 1939 } // namespace |
| 1938 | 1940 |
| 1939 static FrontendPluginRegistry::Add<BlinkGCPluginAction> X( | 1941 static FrontendPluginRegistry::Add<BlinkGCPluginAction> X( |
| 1940 "blink-gc-plugin", | 1942 "blink-gc-plugin", |
| 1941 "Check Blink GC invariants"); | 1943 "Check Blink GC invariants"); |
| OLD | NEW |