Remove linux_chromium_gn_dbg from the chromium CQ.
[chromium-blink-merge.git] / tools / clang / blink_gc_plugin / CheckGCRootsVisitor.h
blobb3cede16f9109ad7cd2554cd6be228b4c786804b
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef TOOLS_BLINK_GC_PLUGIN_CHECK_GC_ROOTS_VISITOR_H_
6 #define TOOLS_BLINK_GC_PLUGIN_CHECK_GC_ROOTS_VISITOR_H_
8 #include <set>
9 #include <vector>
11 #include "Edge.h"
12 #include "RecordInfo.h"
14 // This visitor checks that the fields of a class and the fields of
15 // its part objects don't define GC roots.
16 class CheckGCRootsVisitor : public RecursiveEdgeVisitor {
17 public:
18 typedef std::vector<FieldPoint*> RootPath;
19 typedef std::set<RecordInfo*> VisitingSet;
20 typedef std::vector<RootPath> Errors;
22 CheckGCRootsVisitor();
24 Errors& gc_roots();
26 bool ContainsGCRoots(RecordInfo* info);
28 void VisitValue(Value* edge) override;
29 void VisitPersistent(Persistent* edge) override;
30 void AtCollection(Collection* edge) override;
32 private:
33 RootPath current_;
34 VisitingSet visiting_set_;
35 Errors gc_roots_;
38 #endif // TOOLS_BLINK_GC_PLUGIN_CHECK_GC_ROOTS_VISITOR_H_