Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Unified Diff: tools/clang/blink_gc_plugin/RecordInfo.h

Issue 1645763004: blink_gc_plugin: Make RecordInfo::Get{Fields,Bases} return deterministic order (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/clang/blink_gc_plugin/CheckTraceVisitor.cpp ('k') | tools/clang/blink_gc_plugin/RecordInfo.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/clang/blink_gc_plugin/RecordInfo.h
diff --git a/tools/clang/blink_gc_plugin/RecordInfo.h b/tools/clang/blink_gc_plugin/RecordInfo.h
index 1a25d8342b8a22b5c605079e4a1637be09ecaf5a..c8a4d466d226690dbee5a8a9f5f2e35aded91a51 100644
--- a/tools/clang/blink_gc_plugin/RecordInfo.h
+++ b/tools/clang/blink_gc_plugin/RecordInfo.h
@@ -69,16 +69,22 @@ class FieldPoint : public GraphPoint {
// Wrapper class to lazily collect information about a C++ record.
class RecordInfo {
public:
- typedef std::map<clang::CXXRecordDecl*, BasePoint> Bases;
Nico 2016/01/29 03:10:08 would giving the map a custom comparator that comp
hans 2016/01/29 04:49:14 For Bases, a map doesn't seem to buy as anything a
sof 2016/01/29 09:00:19 What you propose makes the most sense to me, use a
- typedef std::map<clang::FieldDecl*, FieldPoint> Fields;
+ typedef std::pair<clang::CXXRecordDecl*, BasePoint> Base;
+ typedef std::vector<Base> Bases;
+ typedef std::pair<clang::FieldDecl*, FieldPoint> Field;
+ typedef std::vector<Field> Fields;
typedef std::vector<const clang::Type*> TemplateArgs;
~RecordInfo();
clang::CXXRecordDecl* record() const { return record_; }
const std::string& name() const { return name_; }
+
Fields& GetFields();
+ bool HasField(clang::FieldDecl*);
+ Field& GetField(clang::FieldDecl*);
Bases& GetBases();
+
clang::CXXMethodDecl* GetTraceMethod();
clang::CXXMethodDecl* GetTraceDispatchMethod();
clang::CXXMethodDecl* GetFinalizeDispatchMethod();
@@ -115,8 +121,8 @@ class RecordInfo {
void walkBases();
- Fields* CollectFields();
- Bases* CollectBases();
+ void CollectFields();
+ void CollectBases();
void DetermineTracingMethods();
bool InheritsTrace();
@@ -128,6 +134,7 @@ class RecordInfo {
TracingStatus fields_need_tracing_;
Bases* bases_;
Fields* fields_;
+ std::map<clang::FieldDecl*, size_t>* field_map_;
enum CachedBool { kFalse = 0, kTrue = 1, kNotComputed = 2 };
CachedBool is_stack_allocated_;
« no previous file with comments | « tools/clang/blink_gc_plugin/CheckTraceVisitor.cpp ('k') | tools/clang/blink_gc_plugin/RecordInfo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698