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

Unified Diff: src/sksl/ir/SkSLVarDeclaration.h

Issue 2405383003: added basic dataflow analysis to skslc (Closed)
Patch Set: I have no idea what I was thinking Created 4 years, 2 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 | « src/sksl/ir/SkSLInterfaceBlock.h ('k') | src/sksl/ir/SkSLVarDeclarationStatement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/sksl/ir/SkSLVarDeclaration.h
diff --git a/src/sksl/ir/SkSLVarDeclaration.h b/src/sksl/ir/SkSLVarDeclaration.h
deleted file mode 100644
index e64a874d69df2d9a66bd5055301ba5d5c848829e..0000000000000000000000000000000000000000
--- a/src/sksl/ir/SkSLVarDeclaration.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright 2016 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef SKSL_VARDECLARATIONS
-#define SKSL_VARDECLARATIONS
-
-#include "SkSLExpression.h"
-#include "SkSLStatement.h"
-#include "SkSLVariable.h"
-
-namespace SkSL {
-
-/**
- * A single variable declaration within a var declaration statement. For instance, the statement
- * 'int x = 2, y[3];' is a VarDeclarations statement containing two individual VarDeclaration
- * instances.
- */
-struct VarDeclaration {
- VarDeclaration(const Variable* var,
- std::vector<std::unique_ptr<Expression>> sizes,
- std::unique_ptr<Expression> value)
- : fVar(var)
- , fSizes(std::move(sizes))
- , fValue(std::move(value)) {}
-
- std::string description() const {
- std::string result = fVar->fName;
- for (const auto& size : fSizes) {
- if (size) {
- result += "[" + size->description() + "]";
- } else {
- result += "[]";
- }
- }
- if (fValue) {
- result += " = " + fValue->description();
- }
- return result;
- }
-
- const Variable* fVar;
- std::vector<std::unique_ptr<Expression>> fSizes;
- std::unique_ptr<Expression> fValue;
-};
-
-/**
- * A variable declaration statement, which may consist of one or more individual variables.
- */
-struct VarDeclarations : public ProgramElement {
- VarDeclarations(Position position, const Type* baseType,
- std::vector<VarDeclaration> vars)
- : INHERITED(position, kVar_Kind)
- , fBaseType(*baseType)
- , fVars(std::move(vars)) {}
-
- std::string description() const override {
- if (!fVars.size()) {
- return "";
- }
- std::string result = fVars[0].fVar->fModifiers.description() + fBaseType.description() +
- " ";
- std::string separator = "";
- for (const auto& var : fVars) {
- result += separator;
- separator = ", ";
- result += var.description();
- }
- return result;
- }
-
- const Type& fBaseType;
- const std::vector<VarDeclaration> fVars;
-
- typedef ProgramElement INHERITED;
-};
-
-} // namespace
-
-#endif
« no previous file with comments | « src/sksl/ir/SkSLInterfaceBlock.h ('k') | src/sksl/ir/SkSLVarDeclarationStatement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698