Index: src/sksl/ir/SkSLVariable.h |
diff --git a/src/sksl/ir/SkSLVariable.h b/src/sksl/ir/SkSLVariable.h |
index 39af3093b6ab20ce53e35501b00906c88075344e..d4ea2c4a43e78ce8c2ba829dace13b8accd3f1c4 100644 |
--- a/src/sksl/ir/SkSLVariable.h |
+++ b/src/sksl/ir/SkSLVariable.h |
@@ -27,7 +27,7 @@ |
kParameter_Storage |
}; |
- Variable(Position position, Modifiers modifiers, std::string name, const Type& type, |
+ Variable(Position position, Modifiers modifiers, std::string name, std::shared_ptr<Type> type, |
Storage storage) |
: INHERITED(position, kVariable_Kind, std::move(name)) |
, fModifiers(modifiers) |
@@ -37,11 +37,12 @@ |
, fIsWrittenTo(false) {} |
virtual std::string description() const override { |
- return fModifiers.description() + fType.fName + " " + fName; |
+ return fModifiers.description() + fType->fName + " " + fName; |
} |
const Modifiers fModifiers; |
- const Type& fType; |
+ const std::string fValue; |
+ const std::shared_ptr<Type> fType; |
const Storage fStorage; |
mutable bool fIsReadFrom; |
@@ -52,4 +53,14 @@ |
} // namespace SkSL |
+namespace std { |
+ template <> |
+ struct hash<SkSL::Variable> { |
+ public : |
+ size_t operator()(const SkSL::Variable &var) const{ |
+ return hash<std::string>()(var.fName) ^ hash<std::string>()(var.fType->description()); |
+ } |
+ }; |
+} // namespace std |
+ |
#endif |