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

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

Issue 1274403002: GC plugin: consider references equal to raw pointers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Propagate reference type into error/warning messages Created 5 years, 4 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/BlinkGCPlugin.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/Edge.h
diff --git a/tools/clang/blink_gc_plugin/Edge.h b/tools/clang/blink_gc_plugin/Edge.h
index 2ea8e544e8e6905ada5f967321683fde0ed8a89a..29e5f25b1d1253f884bfce0bce5f92f3635d5ff5 100644
--- a/tools/clang/blink_gc_plugin/Edge.h
+++ b/tools/clang/blink_gc_plugin/Edge.h
@@ -124,8 +124,14 @@ class PtrEdge : public Edge {
class RawPtr : public PtrEdge {
public:
- explicit RawPtr(Edge* ptr, bool is_ptr_class)
- : PtrEdge(ptr), is_ptr_class_(is_ptr_class) { }
+ RawPtr(Edge* ptr, bool is_ptr_class, bool is_ref_type)
+ : PtrEdge(ptr)
+ , is_ptr_class_(is_ptr_class)
+ , is_ref_type_(is_ref_type)
+ {
+ assert(!(is_ptr_class_ && is_ref_type_));
+ }
+
bool IsRawPtr() { return true; }
bool IsRawPtrClass() { return is_ptr_class_; }
LivenessKind Kind() { return kWeak; }
@@ -134,8 +140,11 @@ class RawPtr : public PtrEdge {
return TracingStatus::Unneeded();
}
void Accept(EdgeVisitor* visitor) { visitor->VisitRawPtr(this); }
+
+ bool HasReferenceType() { return is_ref_type_; }
private:
bool is_ptr_class_;
+ bool is_ref_type_;
};
class RefPtr : public PtrEdge {
« no previous file with comments | « tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp ('k') | tools/clang/blink_gc_plugin/RecordInfo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698