diff options
author | Ethan Nicholas <ethannicholas@google.com> | 2017-11-01 10:47:43 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-11-07 14:28:18 +0000 |
commit | 1ae353c887fdf447e1fe627e3cd29f8fa62c2a05 (patch) | |
tree | a9d31f9c1b75efe0b543e15730432b938f2ebce7 /src/sksl/ir/SkSLVariable.h | |
parent | 427293c17ee807d014158990770a6efad9a9a4e6 (diff) |
refactored SkSLVarDeclaration out of existence
Bug: skia:
Change-Id: I3dbc08e6d759f6828a472246d4797babb6cc132e
Reviewed-on: https://skia-review.googlesource.com/66147
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'src/sksl/ir/SkSLVariable.h')
-rw-r--r-- | src/sksl/ir/SkSLVariable.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/sksl/ir/SkSLVariable.h b/src/sksl/ir/SkSLVariable.h index 536d1e6b6d..a6c3560c29 100644 --- a/src/sksl/ir/SkSLVariable.h +++ b/src/sksl/ir/SkSLVariable.h @@ -15,6 +15,8 @@ namespace SkSL { +struct Expression; + /** * Represents a variable, whether local, global, or a function parameter. This represents the * variable itself (the storage location), which is shared between all VariableReferences which @@ -28,13 +30,16 @@ struct Variable : public Symbol { }; Variable(int offset, Modifiers modifiers, StringFragment name, const Type& type, - Storage storage) + Storage storage, std::unique_ptr<Expression> initialValue, + std::vector<std::unique_ptr<Expression>> sizes) : INHERITED(offset, kVariable_Kind, name) , fModifiers(modifiers) , fType(type) , fStorage(storage) , fReadCount(0) - , fWriteCount(0) {} + , fWriteCount(0) + , fInitialValue(std::move(initialValue)) + , fSizes(std::move(sizes)) {} virtual String description() const override { return fModifiers.description() + fType.fName + " " + fName; @@ -55,6 +60,9 @@ struct Variable : public Symbol { // eliminated. mutable int fWriteCount; + std::unique_ptr<Expression> fInitialValue; + std::vector<std::unique_ptr<Expression>> fSizes; + typedef Symbol INHERITED; }; |