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 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1093 return; | 1093 return; |
1094 } | 1094 } |
1095 ReportBaseClassMustDeclareVirtualTrace(info, left_most); | 1095 ReportBaseClassMustDeclareVirtualTrace(info, left_most); |
1096 return; | 1096 return; |
1097 } | 1097 } |
1098 | 1098 |
1099 // Check condition (2): | 1099 // Check condition (2): |
1100 if (DeclaresVirtualMethods(left_most)) | 1100 if (DeclaresVirtualMethods(left_most)) |
1101 return; | 1101 return; |
1102 if (left_most_base) { | 1102 if (left_most_base) { |
1103 ++it; // Get the base next to the "safe polymorphic base" | 1103 // Get the base next to the "safe polymorphic base" |
| 1104 if (it != left_most->bases_end()) |
| 1105 ++it; |
1104 if (it != left_most->bases_end()) { | 1106 if (it != left_most->bases_end()) { |
1105 if (CXXRecordDecl* next_base = it->getType()->getAsCXXRecordDecl()) { | 1107 if (CXXRecordDecl* next_base = it->getType()->getAsCXXRecordDecl()) { |
1106 if (CXXRecordDecl* next_left_most = GetLeftMostBase(next_base)) { | 1108 if (CXXRecordDecl* next_left_most = GetLeftMostBase(next_base)) { |
1107 if (DeclaresVirtualMethods(next_left_most)) | 1109 if (DeclaresVirtualMethods(next_left_most)) |
1108 return; | 1110 return; |
1109 ReportLeftMostBaseMustBePolymorphic(info, next_left_most); | 1111 ReportLeftMostBaseMustBePolymorphic(info, next_left_most); |
1110 return; | 1112 return; |
1111 } | 1113 } |
1112 } | 1114 } |
1113 } | 1115 } |
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1906 | 1908 |
1907 private: | 1909 private: |
1908 BlinkGCPluginOptions options_; | 1910 BlinkGCPluginOptions options_; |
1909 }; | 1911 }; |
1910 | 1912 |
1911 } // namespace | 1913 } // namespace |
1912 | 1914 |
1913 static FrontendPluginRegistry::Add<BlinkGCPluginAction> X( | 1915 static FrontendPluginRegistry::Add<BlinkGCPluginAction> X( |
1914 "blink-gc-plugin", | 1916 "blink-gc-plugin", |
1915 "Check Blink GC invariants"); | 1917 "Check Blink GC invariants"); |
OLD | NEW |