Commit e5a1f271 by Corentin Wallez

Use override in all the places where it is possible

This will avoid -Winconsistent-overrides in the future. Done using the -Wsuggest-override warning of GCC 5.1 BUG= Change-Id: I707a649dc368f5dd1e139fd144370abcac0b6263 Reviewed-on: https://chromium-review.googlesource.com/294920Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent 37c3979e
...@@ -154,7 +154,7 @@ class DefinedParser : public Lexer ...@@ -154,7 +154,7 @@ class DefinedParser : public Lexer
} }
protected: protected:
virtual void lex(Token *token) void lex(Token *token) override
{ {
const char kDefined[] = "defined"; const char kDefined[] = "defined";
......
...@@ -27,7 +27,7 @@ class DirectiveParser : public Lexer ...@@ -27,7 +27,7 @@ class DirectiveParser : public Lexer
Diagnostics *diagnostics, Diagnostics *diagnostics,
DirectiveHandler *directiveHandler); DirectiveHandler *directiveHandler);
virtual void lex(Token *token); void lex(Token *token) override;
private: private:
PP_DISALLOW_COPY_AND_ASSIGN(DirectiveParser); PP_DISALLOW_COPY_AND_ASSIGN(DirectiveParser);
......
...@@ -26,7 +26,7 @@ class TokenLexer : public Lexer ...@@ -26,7 +26,7 @@ class TokenLexer : public Lexer
mIter = mTokens.begin(); mIter = mTokens.begin();
} }
virtual void lex(Token *token) void lex(Token *token) override
{ {
if (mIter == mTokens.end()) if (mIter == mTokens.end())
{ {
......
...@@ -24,9 +24,9 @@ class MacroExpander : public Lexer ...@@ -24,9 +24,9 @@ class MacroExpander : public Lexer
{ {
public: public:
MacroExpander(Lexer *lexer, MacroSet *macroSet, Diagnostics *diagnostics); MacroExpander(Lexer *lexer, MacroSet *macroSet, Diagnostics *diagnostics);
virtual ~MacroExpander(); ~MacroExpander() override;
virtual void lex(Token *token); void lex(Token *token) override;
private: private:
PP_DISALLOW_COPY_AND_ASSIGN(MacroExpander); PP_DISALLOW_COPY_AND_ASSIGN(MacroExpander);
......
...@@ -42,7 +42,7 @@ class Tokenizer : public Lexer ...@@ -42,7 +42,7 @@ class Tokenizer : public Lexer
void setLineNumber(int line); void setLineNumber(int line);
void setMaxTokenSize(size_t maxTokenSize); void setMaxTokenSize(size_t maxTokenSize);
virtual void lex(Token *token); void lex(Token *token) override;
private: private:
PP_DISALLOW_COPY_AND_ASSIGN(Tokenizer); PP_DISALLOW_COPY_AND_ASSIGN(Tokenizer);
......
...@@ -17,7 +17,7 @@ class BuiltInFunctionEmulator::BuiltInFunctionEmulationMarker : public TIntermTr ...@@ -17,7 +17,7 @@ class BuiltInFunctionEmulator::BuiltInFunctionEmulationMarker : public TIntermTr
{ {
} }
virtual bool visitUnary(Visit visit, TIntermUnary *node) bool visitUnary(Visit visit, TIntermUnary *node) override
{ {
if (visit == PreVisit) if (visit == PreVisit)
{ {
...@@ -28,7 +28,7 @@ class BuiltInFunctionEmulator::BuiltInFunctionEmulationMarker : public TIntermTr ...@@ -28,7 +28,7 @@ class BuiltInFunctionEmulator::BuiltInFunctionEmulationMarker : public TIntermTr
return true; return true;
} }
virtual bool visitAggregate(Visit visit, TIntermAggregate *node) bool visitAggregate(Visit visit, TIntermAggregate *node) override
{ {
if (visit == PreVisit) if (visit == PreVisit)
{ {
......
...@@ -67,8 +67,8 @@ class TCompiler : public TShHandleBase ...@@ -67,8 +67,8 @@ class TCompiler : public TShHandleBase
{ {
public: public:
TCompiler(sh::GLenum type, ShShaderSpec spec, ShShaderOutput output); TCompiler(sh::GLenum type, ShShaderSpec spec, ShShaderOutput output);
virtual ~TCompiler(); ~TCompiler() override;
virtual TCompiler* getAsCompiler() { return this; } TCompiler *getAsCompiler() override { return this; }
bool Init(const ShBuiltInResources& resources); bool Init(const ShBuiltInResources& resources);
......
...@@ -16,7 +16,7 @@ class TDiagnostics : public pp::Diagnostics, angle::NonCopyable ...@@ -16,7 +16,7 @@ class TDiagnostics : public pp::Diagnostics, angle::NonCopyable
{ {
public: public:
TDiagnostics(TInfoSink& infoSink); TDiagnostics(TInfoSink& infoSink);
virtual ~TDiagnostics(); ~TDiagnostics() override;
TInfoSink& infoSink() { return mInfoSink; } TInfoSink& infoSink() { return mInfoSink; }
...@@ -30,9 +30,7 @@ class TDiagnostics : public pp::Diagnostics, angle::NonCopyable ...@@ -30,9 +30,7 @@ class TDiagnostics : public pp::Diagnostics, angle::NonCopyable
const std::string& extra); const std::string& extra);
protected: protected:
virtual void print(ID id, void print(ID id, const pp::SourceLocation &loc, const std::string &text) override;
const pp::SourceLocation& loc,
const std::string& text);
private: private:
TInfoSink& mInfoSink; TInfoSink& mInfoSink;
......
...@@ -21,25 +21,23 @@ class TDirectiveHandler : public pp::DirectiveHandler, angle::NonCopyable ...@@ -21,25 +21,23 @@ class TDirectiveHandler : public pp::DirectiveHandler, angle::NonCopyable
TDiagnostics& diagnostics, TDiagnostics& diagnostics,
int& shaderVersion, int& shaderVersion,
bool debugShaderPrecisionSupported); bool debugShaderPrecisionSupported);
virtual ~TDirectiveHandler(); ~TDirectiveHandler() override;
const TPragma& pragma() const { return mPragma; } const TPragma& pragma() const { return mPragma; }
const TExtensionBehavior& extensionBehavior() const { return mExtensionBehavior; } const TExtensionBehavior& extensionBehavior() const { return mExtensionBehavior; }
virtual void handleError(const pp::SourceLocation& loc, void handleError(const pp::SourceLocation &loc, const std::string &msg) override;
const std::string& msg);
virtual void handlePragma(const pp::SourceLocation& loc, void handlePragma(const pp::SourceLocation &loc,
const std::string& name, const std::string &name,
const std::string& value, const std::string &value,
bool stdgl); bool stdgl) override;
virtual void handleExtension(const pp::SourceLocation& loc, void handleExtension(const pp::SourceLocation &loc,
const std::string& name, const std::string &name,
const std::string& behavior); const std::string &behavior) override;
virtual void handleVersion(const pp::SourceLocation& loc, void handleVersion(const pp::SourceLocation &loc, int version) override;
int version);
private: private:
TPragma mPragma; TPragma mPragma;
......
...@@ -23,10 +23,10 @@ class EmulatePrecision : public TLValueTrackingTraverser ...@@ -23,10 +23,10 @@ class EmulatePrecision : public TLValueTrackingTraverser
public: public:
EmulatePrecision(const TSymbolTable &symbolTable, int shaderVersion); EmulatePrecision(const TSymbolTable &symbolTable, int shaderVersion);
virtual void visitSymbol(TIntermSymbol *node); void visitSymbol(TIntermSymbol *node) override;
virtual bool visitBinary(Visit visit, TIntermBinary *node); bool visitBinary(Visit visit, TIntermBinary *node) override;
virtual bool visitUnary(Visit visit, TIntermUnary *node); bool visitUnary(Visit visit, TIntermUnary *node) override;
virtual bool visitAggregate(Visit visit, TIntermAggregate *node); bool visitAggregate(Visit visit, TIntermAggregate *node) override;
void writeEmulationHelpers(TInfoSinkBase& sink, ShShaderOutput outputLanguage); void writeEmulationHelpers(TInfoSinkBase& sink, ShShaderOutput outputLanguage);
......
...@@ -27,8 +27,8 @@ class FlagStd140Structs : public TIntermTraverser ...@@ -27,8 +27,8 @@ class FlagStd140Structs : public TIntermTraverser
const std::vector<TIntermTyped *> getFlaggedNodes() const { return mFlaggedNodes; } const std::vector<TIntermTyped *> getFlaggedNodes() const { return mFlaggedNodes; }
protected: protected:
virtual bool visitBinary(Visit visit, TIntermBinary *binaryNode); bool visitBinary(Visit visit, TIntermBinary *binaryNode) override;
virtual void visitSymbol(TIntermSymbol *symbol); void visitSymbol(TIntermSymbol *symbol) override;
private: private:
bool isInStd140InterfaceBlock(TIntermTyped *node) const; bool isInStd140InterfaceBlock(TIntermTyped *node) const;
......
...@@ -32,9 +32,9 @@ class ForLoopUnrollMarker : public TIntermTraverser ...@@ -32,9 +32,9 @@ class ForLoopUnrollMarker : public TIntermTraverser
{ {
} }
virtual bool visitBinary(Visit, TIntermBinary *node); bool visitBinary(Visit, TIntermBinary *node) override;
virtual bool visitLoop(Visit, TIntermLoop *node); bool visitLoop(Visit, TIntermLoop *node) override;
virtual void visitSymbol(TIntermSymbol *node); void visitSymbol(TIntermSymbol *node) override;
bool samplerArrayIndexIsFloatLoopIndex() const bool samplerArrayIndexIsFloatLoopIndex() const
{ {
......
...@@ -33,13 +33,13 @@ class InitializeVariables : public TIntermTraverser ...@@ -33,13 +33,13 @@ class InitializeVariables : public TIntermTraverser
} }
protected: protected:
virtual bool visitBinary(Visit, TIntermBinary *node) { return false; } bool visitBinary(Visit, TIntermBinary *node) override { return false; }
virtual bool visitUnary(Visit, TIntermUnary *node) { return false; } bool visitUnary(Visit, TIntermUnary *node) override { return false; }
virtual bool visitSelection(Visit, TIntermSelection *node) { return false; } bool visitSelection(Visit, TIntermSelection *node) override { return false; }
virtual bool visitLoop(Visit, TIntermLoop *node) { return false; } bool visitLoop(Visit, TIntermLoop *node) override { return false; }
virtual bool visitBranch(Visit, TIntermBranch *node) { return false; } bool visitBranch(Visit, TIntermBranch *node) override { return false; }
virtual bool visitAggregate(Visit visit, TIntermAggregate* node); bool visitAggregate(Visit visit, TIntermAggregate *node) override;
private: private:
void insertInitCode(TIntermSequence *sequence); void insertInitCode(TIntermSequence *sequence);
......
...@@ -21,7 +21,8 @@ public: ...@@ -21,7 +21,8 @@ public:
bool forceHighp); bool forceHighp);
protected: protected:
virtual bool writeVariablePrecision(TPrecision precision); bool writeVariablePrecision(TPrecision precision) override;
private: private:
bool mForceHighp; bool mForceHighp;
}; };
......
...@@ -21,9 +21,9 @@ class TOutputGLSL : public TOutputGLSLBase ...@@ -21,9 +21,9 @@ class TOutputGLSL : public TOutputGLSLBase
ShShaderOutput output); ShShaderOutput output);
protected: protected:
virtual bool writeVariablePrecision(TPrecision); bool writeVariablePrecision(TPrecision) override;
virtual void visitSymbol(TIntermSymbol* node); void visitSymbol(TIntermSymbol *node) override;
virtual TString translateTextureFunction(TString& name); TString translateTextureFunction(TString &name) override;
}; };
#endif // COMPILER_TRANSLATOR_OUTPUTGLSL_H_ #endif // COMPILER_TRANSLATOR_OUTPUTGLSL_H_
...@@ -39,16 +39,16 @@ class TOutputGLSLBase : public TIntermTraverser ...@@ -39,16 +39,16 @@ class TOutputGLSLBase : public TIntermTraverser
void writeConstructorTriplet(Visit visit, const TType &type, const char *constructorBaseType); void writeConstructorTriplet(Visit visit, const TType &type, const char *constructorBaseType);
TString getTypeName(const TType &type); TString getTypeName(const TType &type);
virtual void visitSymbol(TIntermSymbol *node); void visitSymbol(TIntermSymbol *node) override;
virtual void visitConstantUnion(TIntermConstantUnion *node); void visitConstantUnion(TIntermConstantUnion *node) override;
virtual bool visitBinary(Visit visit, TIntermBinary *node); bool visitBinary(Visit visit, TIntermBinary *node) override;
virtual bool visitUnary(Visit visit, TIntermUnary *node); bool visitUnary(Visit visit, TIntermUnary *node) override;
virtual bool visitSelection(Visit visit, TIntermSelection *node); bool visitSelection(Visit visit, TIntermSelection *node) override;
virtual bool visitSwitch(Visit visit, TIntermSwitch *node); bool visitSwitch(Visit visit, TIntermSwitch *node) override;
virtual bool visitCase(Visit visit, TIntermCase *node); bool visitCase(Visit visit, TIntermCase *node) override;
virtual bool visitAggregate(Visit visit, TIntermAggregate *node); bool visitAggregate(Visit visit, TIntermAggregate *node) override;
virtual bool visitLoop(Visit visit, TIntermLoop *node); bool visitLoop(Visit visit, TIntermLoop *node) override;
virtual bool visitBranch(Visit visit, TIntermBranch *node); bool visitBranch(Visit visit, TIntermBranch *node) override;
void visitCodeBlock(TIntermNode *node); void visitCodeBlock(TIntermNode *node);
......
...@@ -23,8 +23,8 @@ class RegenerateStructNames : public TIntermTraverser ...@@ -23,8 +23,8 @@ class RegenerateStructNames : public TIntermTraverser
mScopeDepth(0) {} mScopeDepth(0) {}
protected: protected:
virtual void visitSymbol(TIntermSymbol *); void visitSymbol(TIntermSymbol *) override;
virtual bool visitAggregate(Visit, TIntermAggregate *); bool visitAggregate(Visit, TIntermAggregate *) override;
private: private:
const TSymbolTable &mSymbolTable; const TSymbolTable &mSymbolTable;
......
...@@ -20,7 +20,7 @@ public: ...@@ -20,7 +20,7 @@ public:
, mOldFunctionName(oldFunctionName) , mOldFunctionName(oldFunctionName)
, mNewFunctionName(newFunctionName) {} , mNewFunctionName(newFunctionName) {}
virtual bool visitAggregate(Visit visit, TIntermAggregate* node) bool visitAggregate(Visit visit, TIntermAggregate *node) override
{ {
TOperator op = node->getOp(); TOperator op = node->getOp();
if ((op == EOpFunction || op == EOpFunctionCall) && node->getName() == mOldFunctionName) if ((op == EOpFunction || op == EOpFunctionCall) && node->getName() == mOldFunctionName)
......
...@@ -20,7 +20,7 @@ class ScalarizeVecAndMatConstructorArgs : public TIntermTraverser ...@@ -20,7 +20,7 @@ class ScalarizeVecAndMatConstructorArgs : public TIntermTraverser
mFragmentPrecisionHigh(fragmentPrecisionHigh) {} mFragmentPrecisionHigh(fragmentPrecisionHigh) {}
protected: protected:
virtual bool visitAggregate(Visit visit, TIntermAggregate *node); bool visitAggregate(Visit visit, TIntermAggregate *node) override;
private: private:
void scalarizeArgs(TIntermAggregate *aggregate, void scalarizeArgs(TIntermAggregate *aggregate,
......
...@@ -20,7 +20,7 @@ class SearchSymbol : public TIntermTraverser ...@@ -20,7 +20,7 @@ class SearchSymbol : public TIntermTraverser
SearchSymbol(const TString &symbol); SearchSymbol(const TString &symbol);
void traverse(TIntermNode *node); void traverse(TIntermNode *node);
void visitSymbol(TIntermSymbol *symbolNode); void visitSymbol(TIntermSymbol *symbolNode) override;
bool foundMatch() const; bool foundMatch() const;
......
...@@ -109,13 +109,8 @@ class TVariable : public TSymbol ...@@ -109,13 +109,8 @@ class TVariable : public TSymbol
unionArray(0) unionArray(0)
{ {
} }
virtual ~TVariable() ~TVariable() override {}
{ bool isVariable() const override { return true; }
}
virtual bool isVariable() const
{
return true;
}
TType &getType() TType &getType()
{ {
return type; return type;
...@@ -229,11 +224,8 @@ class TFunction : public TSymbol ...@@ -229,11 +224,8 @@ class TFunction : public TSymbol
{ {
relateToExtension(ext); relateToExtension(ext);
} }
virtual ~TFunction(); ~TFunction() override;
virtual bool isFunction() const bool isFunction() const override { return true; }
{
return true;
}
static TString mangleName(const TString &name) static TString mangleName(const TString &name)
{ {
...@@ -250,7 +242,7 @@ class TFunction : public TSymbol ...@@ -250,7 +242,7 @@ class TFunction : public TSymbol
mangledName = nullptr; mangledName = nullptr;
} }
const TString &getMangledName() const const TString &getMangledName() const override
{ {
if (mangledName == nullptr) if (mangledName == nullptr)
{ {
......
...@@ -161,10 +161,7 @@ class TStructure : public TFieldListCollection ...@@ -161,10 +161,7 @@ class TStructure : public TFieldListCollection
*mutableName = name; *mutableName = name;
} }
virtual TString mangledNamePrefix() const TString mangledNamePrefix() const override { return "struct-"; }
{
return "struct-";
}
int calculateDeepestNesting() const; int calculateDeepestNesting() const;
mutable int mDeepestNesting; mutable int mDeepestNesting;
...@@ -212,10 +209,7 @@ class TInterfaceBlock : public TFieldListCollection ...@@ -212,10 +209,7 @@ class TInterfaceBlock : public TFieldListCollection
} }
private: private:
virtual TString mangledNamePrefix() const TString mangledNamePrefix() const override { return "iblock-"; }
{
return "iblock-";
}
const TString *mInstanceName; // for interface block instance names const TString *mInstanceName; // for interface block instance names
int mArraySize; // 0 if not an array int mArraySize; // 0 if not an array
......
...@@ -25,7 +25,7 @@ class UnfoldShortCircuitAST : public TIntermTraverser ...@@ -25,7 +25,7 @@ class UnfoldShortCircuitAST : public TIntermTraverser
{ {
} }
virtual bool visitBinary(Visit visit, TIntermBinary *); bool visitBinary(Visit visit, TIntermBinary *) override;
}; };
#endif // COMPILER_TRANSLATOR_UNFOLDSHORTCIRCUITAST_H_ #endif // COMPILER_TRANSLATOR_UNFOLDSHORTCIRCUITAST_H_
...@@ -35,7 +35,7 @@ class ValidateConstIndexExpr : public TIntermTraverser ...@@ -35,7 +35,7 @@ class ValidateConstIndexExpr : public TIntermTraverser
// Returns true if the parsed node represents a constant index expression. // Returns true if the parsed node represents a constant index expression.
bool isValid() const { return mValid; } bool isValid() const { return mValid; }
virtual void visitSymbol(TIntermSymbol *symbol) void visitSymbol(TIntermSymbol *symbol) override
{ {
// Only constants and loop indices are allowed in a // Only constants and loop indices are allowed in a
// constant index expression. // constant index expression.
......
...@@ -21,10 +21,10 @@ class ValidateLimitations : public TIntermTraverser ...@@ -21,10 +21,10 @@ class ValidateLimitations : public TIntermTraverser
int numErrors() const { return mNumErrors; } int numErrors() const { return mNumErrors; }
virtual bool visitBinary(Visit, TIntermBinary *); bool visitBinary(Visit, TIntermBinary *) override;
virtual bool visitUnary(Visit, TIntermUnary *); bool visitUnary(Visit, TIntermUnary *) override;
virtual bool visitAggregate(Visit, TIntermAggregate *); bool visitAggregate(Visit, TIntermAggregate *) override;
virtual bool visitLoop(Visit, TIntermLoop *); bool visitLoop(Visit, TIntermLoop *) override;
private: private:
void error(TSourceLoc loc, const char *reason, const char *token); void error(TSourceLoc loc, const char *reason, const char *token);
......
...@@ -21,7 +21,7 @@ class ValidateOutputs : public TIntermTraverser ...@@ -21,7 +21,7 @@ class ValidateOutputs : public TIntermTraverser
int validateAndCountErrors(TInfoSinkBase &sink) const; int validateAndCountErrors(TInfoSinkBase &sink) const;
virtual void visitSymbol(TIntermSymbol*); void visitSymbol(TIntermSymbol *) override;
private: private:
int mMaxDrawBuffers; int mMaxDrawBuffers;
......
...@@ -476,7 +476,7 @@ class NameHashingTraverser : public GetVariableTraverser ...@@ -476,7 +476,7 @@ class NameHashingTraverser : public GetVariableTraverser
{} {}
private: private:
virtual void visitVariable(ShaderVariable *variable) void visitVariable(ShaderVariable *variable) override
{ {
TString stringName = TString(variable->name.c_str()); TString stringName = TString(variable->name.c_str());
variable->mappedName = TIntermTraverser::hash(stringName, mHashFunction).c_str(); variable->mappedName = TIntermTraverser::hash(stringName, mHashFunction).c_str();
......
...@@ -28,9 +28,9 @@ class CollectVariables : public TIntermTraverser ...@@ -28,9 +28,9 @@ class CollectVariables : public TIntermTraverser
ShHashFunction64 hashFunction, ShHashFunction64 hashFunction,
const TSymbolTable &symbolTable); const TSymbolTable &symbolTable);
virtual void visitSymbol(TIntermSymbol *symbol); void visitSymbol(TIntermSymbol *symbol) override;
virtual bool visitAggregate(Visit, TIntermAggregate *node); bool visitAggregate(Visit, TIntermAggregate *node) override;
virtual bool visitBinary(Visit visit, TIntermBinary *binaryNode); bool visitBinary(Visit visit, TIntermBinary *binaryNode) override;
private: private:
template <typename VarT> template <typename VarT>
......
...@@ -56,8 +56,8 @@ class TVersionGLSL : public TIntermTraverser ...@@ -56,8 +56,8 @@ class TVersionGLSL : public TIntermTraverser
// Else 110 is returned. // Else 110 is returned.
int getVersion() const { return mVersion; } int getVersion() const { return mVersion; }
virtual void visitSymbol(TIntermSymbol *); void visitSymbol(TIntermSymbol *) override;
virtual bool visitAggregate(Visit, TIntermAggregate *); bool visitAggregate(Visit, TIntermAggregate *) override;
private: private:
void ensureVersionIsAtLeast(int version); void ensureVersionIsAtLeast(int version);
......
...@@ -81,12 +81,20 @@ class COMPILER_EXPORT Std140BlockEncoder : public BlockLayoutEncoder ...@@ -81,12 +81,20 @@ class COMPILER_EXPORT Std140BlockEncoder : public BlockLayoutEncoder
public: public:
Std140BlockEncoder(); Std140BlockEncoder();
virtual void enterAggregateType(); void enterAggregateType() override;
virtual void exitAggregateType(); void exitAggregateType() override;
protected: protected:
virtual void getBlockLayoutInfo(GLenum type, unsigned int arraySize, bool isRowMajorMatrix, int *arrayStrideOut, int *matrixStrideOut); void getBlockLayoutInfo(GLenum type,
virtual void advanceOffset(GLenum type, unsigned int arraySize, bool isRowMajorMatrix, int arrayStride, int matrixStride); unsigned int arraySize,
bool isRowMajorMatrix,
int *arrayStrideOut,
int *matrixStrideOut) override;
void advanceOffset(GLenum type,
unsigned int arraySize,
bool isRowMajorMatrix,
int arrayStride,
int matrixStride) override;
}; };
} }
......
...@@ -46,9 +46,10 @@ protected: ...@@ -46,9 +46,10 @@ protected:
class TGraphParentNode : public TGraphNode { class TGraphParentNode : public TGraphNode {
public: public:
TGraphParentNode(TIntermNode* node) : TGraphNode(node) {} TGraphParentNode(TIntermNode* node) : TGraphNode(node) {}
virtual ~TGraphParentNode() {} ~TGraphParentNode() override {}
void addDependentNode(TGraphNode* node) { if (node != this) mDependentNodes.insert(node); } void addDependentNode(TGraphNode* node) { if (node != this) mDependentNodes.insert(node); }
virtual void traverse(TDependencyGraphTraverser* graphTraverser); void traverse(TDependencyGraphTraverser *graphTraverser) override;
private: private:
TGraphNodeSet mDependentNodes; TGraphNodeSet mDependentNodes;
}; };
...@@ -61,10 +62,11 @@ public: ...@@ -61,10 +62,11 @@ public:
TGraphArgument(TIntermAggregate* intermFunctionCall, int argumentNumber) TGraphArgument(TIntermAggregate* intermFunctionCall, int argumentNumber)
: TGraphParentNode(intermFunctionCall) : TGraphParentNode(intermFunctionCall)
, mArgumentNumber(argumentNumber) {} , mArgumentNumber(argumentNumber) {}
virtual ~TGraphArgument() {} ~TGraphArgument() override {}
const TIntermAggregate* getIntermFunctionCall() const { return intermNode->getAsAggregate(); } const TIntermAggregate* getIntermFunctionCall() const { return intermNode->getAsAggregate(); }
int getArgumentNumber() const { return mArgumentNumber; } int getArgumentNumber() const { return mArgumentNumber; }
virtual void traverse(TDependencyGraphTraverser* graphTraverser); void traverse(TDependencyGraphTraverser *graphTraverser) override;
private: private:
int mArgumentNumber; int mArgumentNumber;
}; };
...@@ -76,9 +78,9 @@ class TGraphFunctionCall : public TGraphParentNode { ...@@ -76,9 +78,9 @@ class TGraphFunctionCall : public TGraphParentNode {
public: public:
TGraphFunctionCall(TIntermAggregate* intermFunctionCall) TGraphFunctionCall(TIntermAggregate* intermFunctionCall)
: TGraphParentNode(intermFunctionCall) {} : TGraphParentNode(intermFunctionCall) {}
virtual ~TGraphFunctionCall() {} ~TGraphFunctionCall() override {}
const TIntermAggregate* getIntermFunctionCall() const { return intermNode->getAsAggregate(); } const TIntermAggregate* getIntermFunctionCall() const { return intermNode->getAsAggregate(); }
virtual void traverse(TDependencyGraphTraverser* graphTraverser); void traverse(TDependencyGraphTraverser *graphTraverser) override;
}; };
// //
...@@ -87,9 +89,9 @@ public: ...@@ -87,9 +89,9 @@ public:
class TGraphSymbol : public TGraphParentNode { class TGraphSymbol : public TGraphParentNode {
public: public:
TGraphSymbol(TIntermSymbol* intermSymbol) : TGraphParentNode(intermSymbol) {} TGraphSymbol(TIntermSymbol* intermSymbol) : TGraphParentNode(intermSymbol) {}
virtual ~TGraphSymbol() {} ~TGraphSymbol() override {}
const TIntermSymbol* getIntermSymbol() const { return intermNode->getAsSymbolNode(); } const TIntermSymbol* getIntermSymbol() const { return intermNode->getAsSymbolNode(); }
virtual void traverse(TDependencyGraphTraverser* graphTraverser); void traverse(TDependencyGraphTraverser *graphTraverser) override;
}; };
// //
...@@ -98,9 +100,9 @@ public: ...@@ -98,9 +100,9 @@ public:
class TGraphSelection : public TGraphNode { class TGraphSelection : public TGraphNode {
public: public:
TGraphSelection(TIntermSelection* intermSelection) : TGraphNode(intermSelection) {} TGraphSelection(TIntermSelection* intermSelection) : TGraphNode(intermSelection) {}
virtual ~TGraphSelection() {} ~TGraphSelection() override {}
const TIntermSelection* getIntermSelection() const { return intermNode->getAsSelectionNode(); } const TIntermSelection* getIntermSelection() const { return intermNode->getAsSelectionNode(); }
virtual void traverse(TDependencyGraphTraverser* graphTraverser); void traverse(TDependencyGraphTraverser *graphTraverser) override;
}; };
// //
...@@ -109,9 +111,9 @@ public: ...@@ -109,9 +111,9 @@ public:
class TGraphLoop : public TGraphNode { class TGraphLoop : public TGraphNode {
public: public:
TGraphLoop(TIntermLoop* intermLoop) : TGraphNode(intermLoop) {} TGraphLoop(TIntermLoop* intermLoop) : TGraphNode(intermLoop) {}
virtual ~TGraphLoop() {} ~TGraphLoop() override {}
const TIntermLoop* getIntermLoop() const { return intermNode->getAsLoopNode(); } const TIntermLoop* getIntermLoop() const { return intermNode->getAsLoopNode(); }
virtual void traverse(TDependencyGraphTraverser* graphTraverser); void traverse(TDependencyGraphTraverser *graphTraverser) override;
}; };
// //
...@@ -120,10 +122,10 @@ public: ...@@ -120,10 +122,10 @@ public:
class TGraphLogicalOp : public TGraphNode { class TGraphLogicalOp : public TGraphNode {
public: public:
TGraphLogicalOp(TIntermBinary* intermLogicalOp) : TGraphNode(intermLogicalOp) {} TGraphLogicalOp(TIntermBinary* intermLogicalOp) : TGraphNode(intermLogicalOp) {}
virtual ~TGraphLogicalOp() {} ~TGraphLogicalOp() override {}
const TIntermBinary* getIntermLogicalOp() const { return intermNode->getAsBinaryNode(); } const TIntermBinary* getIntermLogicalOp() const { return intermNode->getAsBinaryNode(); }
const char* getOpString() const; const char* getOpString() const;
virtual void traverse(TDependencyGraphTraverser* graphTraverser); void traverse(TDependencyGraphTraverser *graphTraverser) override;
}; };
// //
......
...@@ -18,11 +18,11 @@ class TDependencyGraphBuilder : public TIntermTraverser ...@@ -18,11 +18,11 @@ class TDependencyGraphBuilder : public TIntermTraverser
public: public:
static void build(TIntermNode *node, TDependencyGraph *graph); static void build(TIntermNode *node, TDependencyGraph *graph);
virtual void visitSymbol(TIntermSymbol *); void visitSymbol(TIntermSymbol *) override;
virtual bool visitBinary(Visit visit, TIntermBinary *); bool visitBinary(Visit visit, TIntermBinary *) override;
virtual bool visitSelection(Visit visit, TIntermSelection *); bool visitSelection(Visit visit, TIntermSelection *) override;
virtual bool visitAggregate(Visit visit, TIntermAggregate *); bool visitAggregate(Visit visit, TIntermAggregate *) override;
virtual bool visitLoop(Visit visit, TIntermLoop *); bool visitLoop(Visit visit, TIntermLoop *) override;
private: private:
typedef std::stack<TGraphSymbol *> TSymbolStack; typedef std::stack<TGraphSymbol *> TSymbolStack;
......
...@@ -34,14 +34,14 @@ class TOutputTraverser : public TIntermTraverser ...@@ -34,14 +34,14 @@ class TOutputTraverser : public TIntermTraverser
TInfoSinkBase& sink; TInfoSinkBase& sink;
protected: protected:
void visitSymbol(TIntermSymbol *); void visitSymbol(TIntermSymbol *) override;
void visitConstantUnion(TIntermConstantUnion *); void visitConstantUnion(TIntermConstantUnion *) override;
bool visitBinary(Visit visit, TIntermBinary *); bool visitBinary(Visit visit, TIntermBinary *) override;
bool visitUnary(Visit visit, TIntermUnary *); bool visitUnary(Visit visit, TIntermUnary *) override;
bool visitSelection(Visit visit, TIntermSelection *); bool visitSelection(Visit visit, TIntermSelection *) override;
bool visitAggregate(Visit visit, TIntermAggregate *); bool visitAggregate(Visit visit, TIntermAggregate *) override;
bool visitLoop(Visit visit, TIntermLoop *); bool visitLoop(Visit visit, TIntermLoop *) override;
bool visitBranch(Visit visit, TIntermBranch *); bool visitBranch(Visit visit, TIntermBranch *) override;
}; };
// //
......
...@@ -33,14 +33,14 @@ class TConstTraverser : public TIntermTraverser ...@@ -33,14 +33,14 @@ class TConstTraverser : public TIntermTraverser
bool error; bool error;
protected: protected:
void visitSymbol(TIntermSymbol *); void visitSymbol(TIntermSymbol *) override;
void visitConstantUnion(TIntermConstantUnion *); void visitConstantUnion(TIntermConstantUnion *) override;
bool visitBinary(Visit visit, TIntermBinary *); bool visitBinary(Visit visit, TIntermBinary *) override;
bool visitUnary(Visit visit, TIntermUnary *); bool visitUnary(Visit visit, TIntermUnary *) override;
bool visitSelection(Visit visit, TIntermSelection *); bool visitSelection(Visit visit, TIntermSelection *) override;
bool visitAggregate(Visit visit, TIntermAggregate *); bool visitAggregate(Visit visit, TIntermAggregate *) override;
bool visitLoop(Visit visit, TIntermLoop *); bool visitLoop(Visit visit, TIntermLoop *) override;
bool visitBranch(Visit visit, TIntermBranch *); bool visitBranch(Visit visit, TIntermBranch *) override;
size_t mIndex; size_t mIndex;
TConstantUnion *mUnionArray; TConstantUnion *mUnionArray;
......
...@@ -22,7 +22,8 @@ public: ...@@ -22,7 +22,8 @@ public:
void enforceRestrictions(TIntermNode* root) { root->traverse(this); } void enforceRestrictions(TIntermNode* root) { root->traverse(this); }
int numErrors() { return mNumErrors; } int numErrors() { return mNumErrors; }
virtual void visitSymbol(TIntermSymbol*); void visitSymbol(TIntermSymbol *) override;
private: private:
TInfoSinkBase& mSink; TInfoSinkBase& mSink;
int mNumErrors; int mNumErrors;
......
...@@ -48,7 +48,7 @@ public: ...@@ -48,7 +48,7 @@ public:
{ {
} }
virtual bool visitBinary(Visit visit, TIntermBinary* node) bool visitBinary(Visit visit, TIntermBinary *node) override
{ {
if (node->getOp() == EOpIndexIndirect) if (node->getOp() == EOpIndexIndirect)
{ {
......
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