OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef TOOLS_BLINK_GC_PLUGIN_DIAGNOSTICS_REPORTER_H_ | 5 #ifndef TOOLS_BLINK_GC_PLUGIN_DIAGNOSTICS_REPORTER_H_ |
6 #define TOOLS_BLINK_GC_PLUGIN_DIAGNOSTICS_REPORTER_H_ | 6 #define TOOLS_BLINK_GC_PLUGIN_DIAGNOSTICS_REPORTER_H_ |
7 | 7 |
8 #include "CheckFieldsVisitor.h" | 8 #include "CheckFieldsVisitor.h" |
9 #include "CheckFinalizerVisitor.h" | 9 #include "CheckFinalizerVisitor.h" |
10 #include "CheckGCRootsVisitor.h" | 10 #include "CheckGCRootsVisitor.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 void MissingFinalizeDispatch(const clang::FunctionDecl* dispatch, | 55 void MissingFinalizeDispatch(const clang::FunctionDecl* dispatch, |
56 RecordInfo* receiver); | 56 RecordInfo* receiver); |
57 void StackAllocatedDerivesGarbageCollected(RecordInfo* info, BasePoint* base); | 57 void StackAllocatedDerivesGarbageCollected(RecordInfo* info, BasePoint* base); |
58 void ClassOverridesNew(RecordInfo* info, clang::CXXMethodDecl* newop); | 58 void ClassOverridesNew(RecordInfo* info, clang::CXXMethodDecl* newop); |
59 void ClassDeclaresPureVirtualTrace(RecordInfo* info, | 59 void ClassDeclaresPureVirtualTrace(RecordInfo* info, |
60 clang::CXXMethodDecl* trace); | 60 clang::CXXMethodDecl* trace); |
61 void LeftMostBaseMustBePolymorphic(RecordInfo* derived, | 61 void LeftMostBaseMustBePolymorphic(RecordInfo* derived, |
62 clang::CXXRecordDecl* base); | 62 clang::CXXRecordDecl* base); |
63 void BaseClassMustDeclareVirtualTrace(RecordInfo* derived, | 63 void BaseClassMustDeclareVirtualTrace(RecordInfo* derived, |
64 clang::CXXRecordDecl* base); | 64 clang::CXXRecordDecl* base); |
65 void TraceMethodForStackAllocatedClass(RecordInfo* parent, | 65 void TraceMethodForStackAllocatedClass(RecordInfo* info, |
66 clang::CXXMethodDecl* trace); | 66 clang::CXXMethodDecl* trace); |
| 67 void StaticSingletonContainsScriptWrappable(clang::VarDecl* info); |
67 | 68 |
68 void NoteManualDispatchMethod(clang::CXXMethodDecl* dispatch); | 69 void NoteManualDispatchMethod(clang::CXXMethodDecl* dispatch); |
69 void NoteBaseRequiresTracing(BasePoint* base); | 70 void NoteBaseRequiresTracing(BasePoint* base); |
70 void NoteFieldRequiresTracing(RecordInfo* holder, clang::FieldDecl* field); | 71 void NoteFieldRequiresTracing(RecordInfo* holder, clang::FieldDecl* field); |
71 void NoteFieldShouldNotBeTraced(RecordInfo* holder, clang::FieldDecl* field); | 72 void NoteFieldShouldNotBeTraced(RecordInfo* holder, clang::FieldDecl* field); |
72 void NotePartObjectContainsGCRoot(FieldPoint* point); | 73 void NotePartObjectContainsGCRoot(FieldPoint* point); |
73 void NoteFieldContainsGCRoot(FieldPoint* point); | 74 void NoteFieldContainsGCRoot(FieldPoint* point); |
74 void NoteUserDeclaredDestructor(clang::CXXMethodDecl* dtor); | 75 void NoteUserDeclaredDestructor(clang::CXXMethodDecl* dtor); |
75 void NoteUserDeclaredFinalizer(clang::CXXMethodDecl* dtor); | 76 void NoteUserDeclaredFinalizer(clang::CXXMethodDecl* dtor); |
76 void NoteBaseRequiresFinalization(BasePoint* base); | 77 void NoteBaseRequiresFinalization(BasePoint* base); |
77 void NoteFieldRequiresFinalization(FieldPoint* field); | 78 void NoteFieldRequiresFinalization(FieldPoint* field); |
78 void NoteField(FieldPoint* point, unsigned note); | 79 void NoteField(FieldPoint* point, unsigned note); |
79 void NoteField(clang::FieldDecl* field, unsigned note); | 80 void NoteField(clang::FieldDecl* field, unsigned note); |
80 void NoteOverriddenNonVirtualTrace(clang::CXXMethodDecl* overridden); | 81 void NoteOverriddenNonVirtualTrace(clang::CXXMethodDecl* overridden); |
| 82 void NoteUnsafeScriptWrappableField(clang::VarDecl* decl, |
| 83 const std::string& context, |
| 84 const std::string& type); |
81 | 85 |
82 private: | 86 private: |
83 clang::DiagnosticBuilder ReportDiagnostic( | 87 clang::DiagnosticBuilder ReportDiagnostic(unsigned diag_id); |
84 clang::SourceLocation location, | 88 clang::DiagnosticBuilder ReportDiagnostic(clang::SourceLocation location, |
85 unsigned diag_id); | 89 unsigned diag_id); |
86 | 90 |
87 void ReportMissingDispatchMethod(RecordInfo* info, unsigned error); | 91 void ReportMissingDispatchMethod(RecordInfo* info, unsigned error); |
88 void ReportMissingDispatch(const clang::FunctionDecl* dispatch, | 92 void ReportMissingDispatch(const clang::FunctionDecl* dispatch, |
89 RecordInfo* receiver, | 93 RecordInfo* receiver, |
90 unsigned error); | 94 unsigned error); |
91 | 95 |
92 clang::CompilerInstance& instance_; | 96 clang::CompilerInstance& instance_; |
93 clang::DiagnosticsEngine& diagnostic_; | 97 clang::DiagnosticsEngine& diagnostic_; |
94 | 98 |
95 unsigned diag_class_must_left_mostly_derive_gc_; | 99 unsigned diag_class_must_left_mostly_derive_gc_; |
(...skipping 11 matching lines...) Expand all Loading... |
107 unsigned diag_missing_trace_dispatch_method_; | 111 unsigned diag_missing_trace_dispatch_method_; |
108 unsigned diag_missing_finalize_dispatch_method_; | 112 unsigned diag_missing_finalize_dispatch_method_; |
109 unsigned diag_virtual_and_manual_dispatch_; | 113 unsigned diag_virtual_and_manual_dispatch_; |
110 unsigned diag_missing_trace_dispatch_; | 114 unsigned diag_missing_trace_dispatch_; |
111 unsigned diag_missing_finalize_dispatch_; | 115 unsigned diag_missing_finalize_dispatch_; |
112 unsigned diag_stack_allocated_derives_gc_; | 116 unsigned diag_stack_allocated_derives_gc_; |
113 unsigned diag_class_overrides_new_; | 117 unsigned diag_class_overrides_new_; |
114 unsigned diag_class_declares_pure_virtual_trace_; | 118 unsigned diag_class_declares_pure_virtual_trace_; |
115 unsigned diag_left_most_base_must_be_polymorphic_; | 119 unsigned diag_left_most_base_must_be_polymorphic_; |
116 unsigned diag_base_class_must_declare_virtual_trace_; | 120 unsigned diag_base_class_must_declare_virtual_trace_; |
| 121 unsigned diag_iterator_to_gc_managed_collection_; |
| 122 unsigned diag_trace_method_of_stack_allocated_parent_; |
| 123 unsigned diag_static_singleton_with_scriptwrappable_; |
117 | 124 |
118 unsigned diag_base_requires_tracing_note_; | 125 unsigned diag_base_requires_tracing_note_; |
119 unsigned diag_field_requires_tracing_note_; | 126 unsigned diag_field_requires_tracing_note_; |
120 unsigned diag_field_should_not_be_traced_note_; | 127 unsigned diag_field_should_not_be_traced_note_; |
121 unsigned diag_raw_ptr_to_gc_managed_class_note_; | 128 unsigned diag_raw_ptr_to_gc_managed_class_note_; |
122 unsigned diag_ref_ptr_to_gc_managed_class_note_; | 129 unsigned diag_ref_ptr_to_gc_managed_class_note_; |
123 unsigned diag_reference_ptr_to_gc_managed_class_note_; | 130 unsigned diag_reference_ptr_to_gc_managed_class_note_; |
124 unsigned diag_own_ptr_to_gc_managed_class_note_; | 131 unsigned diag_own_ptr_to_gc_managed_class_note_; |
125 unsigned diag_unique_ptr_to_gc_managed_class_note_; | 132 unsigned diag_unique_ptr_to_gc_managed_class_note_; |
126 unsigned diag_member_to_gc_unmanaged_class_note_; | 133 unsigned diag_member_to_gc_unmanaged_class_note_; |
127 unsigned diag_stack_allocated_field_note_; | 134 unsigned diag_stack_allocated_field_note_; |
128 unsigned diag_member_in_unmanaged_class_note_; | 135 unsigned diag_member_in_unmanaged_class_note_; |
129 unsigned diag_part_object_to_gc_derived_class_note_; | 136 unsigned diag_part_object_to_gc_derived_class_note_; |
130 unsigned diag_part_object_contains_gc_root_note_; | 137 unsigned diag_part_object_contains_gc_root_note_; |
131 unsigned diag_field_contains_gc_root_note_; | 138 unsigned diag_field_contains_gc_root_note_; |
132 unsigned diag_finalized_field_note_; | 139 unsigned diag_finalized_field_note_; |
133 unsigned diag_eagerly_finalized_field_note_; | 140 unsigned diag_eagerly_finalized_field_note_; |
134 unsigned diag_user_declared_destructor_note_; | 141 unsigned diag_user_declared_destructor_note_; |
135 unsigned diag_user_declared_finalizer_note_; | 142 unsigned diag_user_declared_finalizer_note_; |
136 unsigned diag_base_requires_finalization_note_; | 143 unsigned diag_base_requires_finalization_note_; |
137 unsigned diag_field_requires_finalization_note_; | 144 unsigned diag_field_requires_finalization_note_; |
138 unsigned diag_overridden_non_virtual_trace_note_; | 145 unsigned diag_overridden_non_virtual_trace_note_; |
139 unsigned diag_manual_dispatch_method_note_; | 146 unsigned diag_manual_dispatch_method_note_; |
140 unsigned diag_iterator_to_gc_managed_collection_note_; | 147 unsigned diag_unsafe_scriptwrappable_field_note_; |
141 unsigned diag_trace_method_of_stack_allocated_parent_; | |
142 }; | 148 }; |
143 | 149 |
144 #endif // TOOLS_BLINK_GC_PLUGIN_DIAGNOSTICS_REPORTER_H_ | 150 #endif // TOOLS_BLINK_GC_PLUGIN_DIAGNOSTICS_REPORTER_H_ |
OLD | NEW |