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 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
950 | 950 |
951 if (CXXMethodDecl* trace = info->GetTraceMethod()) { | 951 if (CXXMethodDecl* trace = info->GetTraceMethod()) { |
952 if (trace->isPure()) | 952 if (trace->isPure()) |
953 ReportClassDeclaresPureVirtualTrace(info, trace); | 953 ReportClassDeclaresPureVirtualTrace(info, trace); |
954 } else if (info->RequiresTraceMethod()) { | 954 } else if (info->RequiresTraceMethod()) { |
955 ReportClassRequiresTraceMethod(info); | 955 ReportClassRequiresTraceMethod(info); |
956 } | 956 } |
957 | 957 |
958 // Check polymorphic classes that are GC-derived or have a trace method. | 958 // Check polymorphic classes that are GC-derived or have a trace method. |
959 if (info->record()->hasDefinition() && info->record()->isPolymorphic()) { | 959 if (info->record()->hasDefinition() && info->record()->isPolymorphic()) { |
| 960 // TODO: Check classes that inherit a trace method. |
960 CXXMethodDecl* trace = info->GetTraceMethod(); | 961 CXXMethodDecl* trace = info->GetTraceMethod(); |
961 if (trace || info->IsGCDerived()) | 962 if (trace || info->IsGCDerived()) |
962 CheckPolymorphicClass(info, trace); | 963 CheckPolymorphicClass(info, trace); |
963 } | 964 } |
964 | 965 |
965 { | 966 { |
966 CheckFieldsVisitor visitor(options_); | 967 CheckFieldsVisitor visitor(options_); |
967 if (visitor.ContainsInvalidFields(info)) | 968 if (visitor.ContainsInvalidFields(info)) |
968 ReportClassContainsInvalidFields(info, &visitor.invalid_fields()); | 969 ReportClassContainsInvalidFields(info, &visitor.invalid_fields()); |
969 } | 970 } |
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1874 | 1875 |
1875 private: | 1876 private: |
1876 BlinkGCPluginOptions options_; | 1877 BlinkGCPluginOptions options_; |
1877 }; | 1878 }; |
1878 | 1879 |
1879 } // namespace | 1880 } // namespace |
1880 | 1881 |
1881 static FrontendPluginRegistry::Add<BlinkGCPluginAction> X( | 1882 static FrontendPluginRegistry::Add<BlinkGCPluginAction> X( |
1882 "blink-gc-plugin", | 1883 "blink-gc-plugin", |
1883 "Check Blink GC invariants"); | 1884 "Check Blink GC invariants"); |
OLD | NEW |