Commit f462ac1b by Olli Etuaho Committed by Commit Bot

Remove TIntermRaw

It's not used anywhere and removing it will make changing traversal code a bit simpler. BUG=angleproject:2662 TEST=angle_unittests Change-Id: I4a430a09ceb538c8b0e5d1bb0a95f3fd7657c276 Reviewed-on: https://chromium-review.googlesource.com/1098671Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
parent 3e313805
...@@ -55,7 +55,6 @@ class TIntermSymbol; ...@@ -55,7 +55,6 @@ class TIntermSymbol;
class TIntermLoop; class TIntermLoop;
class TInfoSink; class TInfoSink;
class TInfoSinkBase; class TInfoSinkBase;
class TIntermRaw;
class TIntermBranch; class TIntermBranch;
class TSymbolTable; class TSymbolTable;
...@@ -99,7 +98,6 @@ class TIntermNode : angle::NonCopyable ...@@ -99,7 +98,6 @@ class TIntermNode : angle::NonCopyable
virtual TIntermCase *getAsCaseNode() { return 0; } virtual TIntermCase *getAsCaseNode() { return 0; }
virtual TIntermSymbol *getAsSymbolNode() { return 0; } virtual TIntermSymbol *getAsSymbolNode() { return 0; }
virtual TIntermLoop *getAsLoopNode() { return 0; } virtual TIntermLoop *getAsLoopNode() { return 0; }
virtual TIntermRaw *getAsRawNode() { return 0; }
virtual TIntermBranch *getAsBranchNode() { return 0; } virtual TIntermBranch *getAsBranchNode() { return 0; }
// Replace a child node. Return true if |original| is a child // Replace a child node. Return true if |original| is a child
...@@ -281,37 +279,6 @@ class TIntermExpression : public TIntermTyped ...@@ -281,37 +279,6 @@ class TIntermExpression : public TIntermTyped
TType mType; TType mType;
}; };
// A Raw node stores raw code, that the translator will insert verbatim
// into the output stream. Useful for transformation operations that make
// complex code that might not fit naturally into the GLSL model.
class TIntermRaw : public TIntermExpression
{
public:
TIntermRaw(const TType &type, const ImmutableString &rawText)
: TIntermExpression(type), mRawText(rawText)
{
}
TIntermRaw(const TIntermRaw &) = delete;
TIntermTyped *deepCopy() const override
{
UNREACHABLE();
return nullptr;
}
bool hasSideEffects() const override { return false; }
const ImmutableString &getRawText() const { return mRawText; }
void traverse(TIntermTraverser *it) override;
TIntermRaw *getAsRawNode() override { return this; }
bool replaceChildNode(TIntermNode *, TIntermNode *) override { return false; }
protected:
ImmutableString mRawText;
};
// Constant folded node. // Constant folded node.
// Note that nodes may be constant folded and not be constant expressions with the EvqConst // Note that nodes may be constant folded and not be constant expressions with the EvqConst
// qualifier. This happens for example when the following expression is processed: // qualifier. This happens for example when the following expression is processed:
......
...@@ -1010,11 +1010,6 @@ void OutputHLSL::visitSymbol(TIntermSymbol *node) ...@@ -1010,11 +1010,6 @@ void OutputHLSL::visitSymbol(TIntermSymbol *node)
} }
} }
void OutputHLSL::visitRaw(TIntermRaw *node)
{
getInfoSink() << node->getRawText();
}
void OutputHLSL::outputEqual(Visit visit, const TType &type, TOperator op, TInfoSinkBase &out) void OutputHLSL::outputEqual(Visit visit, const TType &type, TOperator op, TInfoSinkBase &out)
{ {
if (type.isScalar() && !type.isArray()) if (type.isScalar() && !type.isArray())
......
...@@ -84,7 +84,6 @@ class OutputHLSL : public TIntermTraverser ...@@ -84,7 +84,6 @@ class OutputHLSL : public TIntermTraverser
// Visit AST nodes and output their code to the body stream // Visit AST nodes and output their code to the body stream
void visitSymbol(TIntermSymbol *) override; void visitSymbol(TIntermSymbol *) override;
void visitRaw(TIntermRaw *) override;
void visitConstantUnion(TIntermConstantUnion *) override; void visitConstantUnion(TIntermConstantUnion *) override;
bool visitSwizzle(Visit visit, TIntermSwizzle *node) override; bool visitSwizzle(Visit visit, TIntermSwizzle *node) override;
bool visitBinary(Visit visit, TIntermBinary *) override; bool visitBinary(Visit visit, TIntermBinary *) override;
......
...@@ -18,11 +18,6 @@ void TIntermSymbol::traverse(TIntermTraverser *it) ...@@ -18,11 +18,6 @@ void TIntermSymbol::traverse(TIntermTraverser *it)
it->traverseSymbol(this); it->traverseSymbol(this);
} }
void TIntermRaw::traverse(TIntermTraverser *it)
{
it->traverseRaw(this);
}
void TIntermConstantUnion::traverse(TIntermTraverser *it) void TIntermConstantUnion::traverse(TIntermTraverser *it)
{ {
it->traverseConstantUnion(this); it->traverseConstantUnion(this);
...@@ -861,10 +856,4 @@ void TIntermTraverser::traverseBranch(TIntermBranch *node) ...@@ -861,10 +856,4 @@ void TIntermTraverser::traverseBranch(TIntermBranch *node)
visitBranch(PostVisit, node); visitBranch(PostVisit, node);
} }
void TIntermTraverser::traverseRaw(TIntermRaw *node)
{
ScopedNodeInTraversalPath addToPath(this, node);
visitRaw(node);
}
} // namespace sh } // namespace sh
...@@ -47,7 +47,6 @@ class TIntermTraverser : angle::NonCopyable ...@@ -47,7 +47,6 @@ class TIntermTraverser : angle::NonCopyable
virtual ~TIntermTraverser(); virtual ~TIntermTraverser();
virtual void visitSymbol(TIntermSymbol *node) {} virtual void visitSymbol(TIntermSymbol *node) {}
virtual void visitRaw(TIntermRaw *node) {}
virtual void visitConstantUnion(TIntermConstantUnion *node) {} virtual void visitConstantUnion(TIntermConstantUnion *node) {}
virtual bool visitSwizzle(Visit visit, TIntermSwizzle *node) { return true; } virtual bool visitSwizzle(Visit visit, TIntermSwizzle *node) { return true; }
virtual bool visitBinary(Visit visit, TIntermBinary *node) { return true; } virtual bool visitBinary(Visit visit, TIntermBinary *node) { return true; }
...@@ -75,7 +74,6 @@ class TIntermTraverser : angle::NonCopyable ...@@ -75,7 +74,6 @@ class TIntermTraverser : angle::NonCopyable
// and calling the visit functions in the appropriate places. They also track some // and calling the visit functions in the appropriate places. They also track some
// context that may be used by the visit functions. // context that may be used by the visit functions.
virtual void traverseSymbol(TIntermSymbol *node); virtual void traverseSymbol(TIntermSymbol *node);
virtual void traverseRaw(TIntermRaw *node);
virtual void traverseConstantUnion(TIntermConstantUnion *node); virtual void traverseConstantUnion(TIntermConstantUnion *node);
virtual void traverseSwizzle(TIntermSwizzle *node); virtual void traverseSwizzle(TIntermSwizzle *node);
virtual void traverseBinary(TIntermBinary *node); virtual void traverseBinary(TIntermBinary *node);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment