summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/angle/src/compiler/translator/depgraph
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/angle/src/compiler/translator/depgraph')
-rw-r--r--src/3rdparty/angle/src/compiler/translator/depgraph/DependencyGraph.cpp2
-rw-r--r--src/3rdparty/angle/src/compiler/translator/depgraph/DependencyGraph.h55
-rw-r--r--src/3rdparty/angle/src/compiler/translator/depgraph/DependencyGraphBuilder.h10
-rw-r--r--src/3rdparty/angle/src/compiler/translator/depgraph/DependencyGraphOutput.cpp3
4 files changed, 27 insertions, 43 deletions
diff --git a/src/3rdparty/angle/src/compiler/translator/depgraph/DependencyGraph.cpp b/src/3rdparty/angle/src/compiler/translator/depgraph/DependencyGraph.cpp
index 19ddf5c439..4dee0dbd2e 100644
--- a/src/3rdparty/angle/src/compiler/translator/depgraph/DependencyGraph.cpp
+++ b/src/3rdparty/angle/src/compiler/translator/depgraph/DependencyGraph.cpp
@@ -4,8 +4,6 @@
// found in the LICENSE file.
//
-#pragma warning(disable: 4718)
-
#include "compiler/translator/depgraph/DependencyGraph.h"
#include "compiler/translator/depgraph/DependencyGraphBuilder.h"
diff --git a/src/3rdparty/angle/src/compiler/translator/depgraph/DependencyGraph.h b/src/3rdparty/angle/src/compiler/translator/depgraph/DependencyGraph.h
index 22db633678..2f7f7b9ab8 100644
--- a/src/3rdparty/angle/src/compiler/translator/depgraph/DependencyGraph.h
+++ b/src/3rdparty/angle/src/compiler/translator/depgraph/DependencyGraph.h
@@ -46,9 +46,10 @@ protected:
class TGraphParentNode : public TGraphNode {
public:
TGraphParentNode(TIntermNode* node) : TGraphNode(node) {}
- virtual ~TGraphParentNode() {}
+ ~TGraphParentNode() override {}
void addDependentNode(TGraphNode* node) { if (node != this) mDependentNodes.insert(node); }
- virtual void traverse(TDependencyGraphTraverser* graphTraverser);
+ void traverse(TDependencyGraphTraverser *graphTraverser) override;
+
private:
TGraphNodeSet mDependentNodes;
};
@@ -61,10 +62,11 @@ public:
TGraphArgument(TIntermAggregate* intermFunctionCall, int argumentNumber)
: TGraphParentNode(intermFunctionCall)
, mArgumentNumber(argumentNumber) {}
- virtual ~TGraphArgument() {}
+ ~TGraphArgument() override {}
const TIntermAggregate* getIntermFunctionCall() const { return intermNode->getAsAggregate(); }
int getArgumentNumber() const { return mArgumentNumber; }
- virtual void traverse(TDependencyGraphTraverser* graphTraverser);
+ void traverse(TDependencyGraphTraverser *graphTraverser) override;
+
private:
int mArgumentNumber;
};
@@ -76,9 +78,9 @@ class TGraphFunctionCall : public TGraphParentNode {
public:
TGraphFunctionCall(TIntermAggregate* intermFunctionCall)
: TGraphParentNode(intermFunctionCall) {}
- virtual ~TGraphFunctionCall() {}
+ ~TGraphFunctionCall() override {}
const TIntermAggregate* getIntermFunctionCall() const { return intermNode->getAsAggregate(); }
- virtual void traverse(TDependencyGraphTraverser* graphTraverser);
+ void traverse(TDependencyGraphTraverser *graphTraverser) override;
};
//
@@ -87,9 +89,9 @@ public:
class TGraphSymbol : public TGraphParentNode {
public:
TGraphSymbol(TIntermSymbol* intermSymbol) : TGraphParentNode(intermSymbol) {}
- virtual ~TGraphSymbol() {}
+ ~TGraphSymbol() override {}
const TIntermSymbol* getIntermSymbol() const { return intermNode->getAsSymbolNode(); }
- virtual void traverse(TDependencyGraphTraverser* graphTraverser);
+ void traverse(TDependencyGraphTraverser *graphTraverser) override;
};
//
@@ -98,9 +100,9 @@ public:
class TGraphSelection : public TGraphNode {
public:
TGraphSelection(TIntermSelection* intermSelection) : TGraphNode(intermSelection) {}
- virtual ~TGraphSelection() {}
+ ~TGraphSelection() override {}
const TIntermSelection* getIntermSelection() const { return intermNode->getAsSelectionNode(); }
- virtual void traverse(TDependencyGraphTraverser* graphTraverser);
+ void traverse(TDependencyGraphTraverser *graphTraverser) override;
};
//
@@ -109,9 +111,9 @@ public:
class TGraphLoop : public TGraphNode {
public:
TGraphLoop(TIntermLoop* intermLoop) : TGraphNode(intermLoop) {}
- virtual ~TGraphLoop() {}
+ ~TGraphLoop() override {}
const TIntermLoop* getIntermLoop() const { return intermNode->getAsLoopNode(); }
- virtual void traverse(TDependencyGraphTraverser* graphTraverser);
+ void traverse(TDependencyGraphTraverser *graphTraverser) override;
};
//
@@ -120,10 +122,10 @@ public:
class TGraphLogicalOp : public TGraphNode {
public:
TGraphLogicalOp(TIntermBinary* intermLogicalOp) : TGraphNode(intermLogicalOp) {}
- virtual ~TGraphLogicalOp() {}
+ ~TGraphLogicalOp() override {}
const TIntermBinary* getIntermLogicalOp() const { return intermNode->getAsBinaryNode(); }
const char* getOpString() const;
- virtual void traverse(TDependencyGraphTraverser* graphTraverser);
+ void traverse(TDependencyGraphTraverser *graphTraverser) override;
};
//
@@ -140,27 +142,11 @@ class TDependencyGraph {
public:
TDependencyGraph(TIntermNode* intermNode);
~TDependencyGraph();
- TGraphNodeVector::const_iterator begin() const { return mAllNodes.begin(); }
- TGraphNodeVector::const_iterator end() const { return mAllNodes.end(); }
-
- TGraphSymbolVector::const_iterator beginSamplerSymbols() const
- {
- return mSamplerSymbols.begin();
- }
-
- TGraphSymbolVector::const_iterator endSamplerSymbols() const
- {
- return mSamplerSymbols.end();
- }
-
- TFunctionCallVector::const_iterator beginUserDefinedFunctionCalls() const
- {
- return mUserDefinedFunctionCalls.begin();
- }
-
- TFunctionCallVector::const_iterator endUserDefinedFunctionCalls() const
+ const TGraphNodeVector &allNodes() const { return mAllNodes; }
+ const TGraphSymbolVector &samplerSymbols() const { return mSamplerSymbols; }
+ const TFunctionCallVector &userDefinedFunctionCalls() const
{
- return mUserDefinedFunctionCalls.end();
+ return mUserDefinedFunctionCalls;
}
TGraphArgument* createArgument(TIntermAggregate* intermFunctionCall, int argumentNumber);
@@ -189,6 +175,7 @@ private:
class TDependencyGraphTraverser : angle::NonCopyable {
public:
TDependencyGraphTraverser() : mDepth(0) {}
+ virtual ~TDependencyGraphTraverser() {}
virtual void visitSymbol(TGraphSymbol* symbol) {};
virtual void visitArgument(TGraphArgument* selection) {};
diff --git a/src/3rdparty/angle/src/compiler/translator/depgraph/DependencyGraphBuilder.h b/src/3rdparty/angle/src/compiler/translator/depgraph/DependencyGraphBuilder.h
index f7b3bd4b43..c7b54f66b7 100644
--- a/src/3rdparty/angle/src/compiler/translator/depgraph/DependencyGraphBuilder.h
+++ b/src/3rdparty/angle/src/compiler/translator/depgraph/DependencyGraphBuilder.h
@@ -18,11 +18,11 @@ class TDependencyGraphBuilder : public TIntermTraverser
public:
static void build(TIntermNode *node, TDependencyGraph *graph);
- virtual void visitSymbol(TIntermSymbol *);
- virtual bool visitBinary(Visit visit, TIntermBinary *);
- virtual bool visitSelection(Visit visit, TIntermSelection *);
- virtual bool visitAggregate(Visit visit, TIntermAggregate *);
- virtual bool visitLoop(Visit visit, TIntermLoop *);
+ void visitSymbol(TIntermSymbol *) override;
+ bool visitBinary(Visit visit, TIntermBinary *) override;
+ bool visitSelection(Visit visit, TIntermSelection *) override;
+ bool visitAggregate(Visit visit, TIntermAggregate *) override;
+ bool visitLoop(Visit visit, TIntermLoop *) override;
private:
typedef std::stack<TGraphSymbol *> TSymbolStack;
diff --git a/src/3rdparty/angle/src/compiler/translator/depgraph/DependencyGraphOutput.cpp b/src/3rdparty/angle/src/compiler/translator/depgraph/DependencyGraphOutput.cpp
index e226333545..32a2f30141 100644
--- a/src/3rdparty/angle/src/compiler/translator/depgraph/DependencyGraphOutput.cpp
+++ b/src/3rdparty/angle/src/compiler/translator/depgraph/DependencyGraphOutput.cpp
@@ -54,9 +54,8 @@ void TDependencyGraphOutput::outputAllSpanningTrees(TDependencyGraph& graph)
{
mSink << "\n";
- for (TGraphNodeVector::const_iterator iter = graph.begin(); iter != graph.end(); ++iter)
+ for (auto symbol : graph.allNodes())
{
- TGraphNode* symbol = *iter;
mSink << "--- Dependency graph spanning tree ---\n";
clearVisited();
symbol->traverse(this);