Commit 8b76e9fb by Corentin Wallez

Fix warnings on Linux

BUG= Change-Id: I24ed2a2ee85a152ef79fc9cb2c3b067bbbaedf05 Reviewed-on: https://chromium-review.googlesource.com/293310Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent 19ba5746
...@@ -99,7 +99,7 @@ class TIntermTyped : public TIntermNode ...@@ -99,7 +99,7 @@ class TIntermTyped : public TIntermNode
{ {
public: public:
TIntermTyped(const TType &t) : mType(t) { } TIntermTyped(const TType &t) : mType(t) { }
virtual TIntermTyped *getAsTyped() { return this; } TIntermTyped *getAsTyped() override { return this; }
virtual bool hasSideEffects() const = 0; virtual bool hasSideEffects() const = 0;
...@@ -154,10 +154,10 @@ class TIntermLoop : public TIntermNode ...@@ -154,10 +154,10 @@ class TIntermLoop : public TIntermNode
mBody(body), mBody(body),
mUnrollFlag(false) { } mUnrollFlag(false) { }
virtual TIntermLoop *getAsLoopNode() { return this; } TIntermLoop *getAsLoopNode() override { return this; }
void traverse(TIntermTraverser *it) override; void traverse(TIntermTraverser *it) override;
virtual bool replaceChildNode( bool replaceChildNode(
TIntermNode *original, TIntermNode *replacement); TIntermNode *original, TIntermNode *replacement) override;
TLoopType getType() const { return mType; } TLoopType getType() const { return mType; }
TIntermNode *getInit() { return mInit; } TIntermNode *getInit() { return mInit; }
...@@ -189,8 +189,8 @@ class TIntermBranch : public TIntermNode ...@@ -189,8 +189,8 @@ class TIntermBranch : public TIntermNode
mExpression(e) { } mExpression(e) { }
void traverse(TIntermTraverser *it) override; void traverse(TIntermTraverser *it) override;
virtual bool replaceChildNode( bool replaceChildNode(
TIntermNode *original, TIntermNode *replacement); TIntermNode *original, TIntermNode *replacement) override;
TOperator getFlowOp() { return mFlowOp; } TOperator getFlowOp() { return mFlowOp; }
TIntermTyped* getExpression() { return mExpression; } TIntermTyped* getExpression() { return mExpression; }
...@@ -217,7 +217,7 @@ class TIntermSymbol : public TIntermTyped ...@@ -217,7 +217,7 @@ class TIntermSymbol : public TIntermTyped
mSymbol = symbol; mSymbol = symbol;
} }
virtual bool hasSideEffects() const { return false; } bool hasSideEffects() const override { return false; }
int getId() const { return mId; } int getId() const { return mId; }
const TString &getSymbol() const { return mSymbol; } const TString &getSymbol() const { return mSymbol; }
...@@ -228,8 +228,8 @@ class TIntermSymbol : public TIntermTyped ...@@ -228,8 +228,8 @@ class TIntermSymbol : public TIntermTyped
void setInternal(bool isInternal) { mInternal = isInternal; } void setInternal(bool isInternal) { mInternal = isInternal; }
void traverse(TIntermTraverser *it) override; void traverse(TIntermTraverser *it) override;
virtual TIntermSymbol *getAsSymbolNode() { return this; } TIntermSymbol *getAsSymbolNode() override { return this; }
virtual bool replaceChildNode(TIntermNode *, TIntermNode *) { return false; } bool replaceChildNode(TIntermNode *, TIntermNode *) override { return false; }
protected: protected:
int mId; int mId;
...@@ -247,14 +247,14 @@ class TIntermRaw : public TIntermTyped ...@@ -247,14 +247,14 @@ class TIntermRaw : public TIntermTyped
: TIntermTyped(type), : TIntermTyped(type),
mRawText(rawText) { } mRawText(rawText) { }
virtual bool hasSideEffects() const { return false; } bool hasSideEffects() const override { return false; }
TString getRawText() const { return mRawText; } TString getRawText() const { return mRawText; }
void traverse(TIntermTraverser *it) override; void traverse(TIntermTraverser *it) override;
virtual TIntermRaw *getAsRawNode() { return this; } TIntermRaw *getAsRawNode() override { return this; }
virtual bool replaceChildNode(TIntermNode *, TIntermNode *) { return false; } bool replaceChildNode(TIntermNode *, TIntermNode *) override { return false; }
protected: protected:
TString mRawText; TString mRawText;
...@@ -267,7 +267,7 @@ class TIntermConstantUnion : public TIntermTyped ...@@ -267,7 +267,7 @@ class TIntermConstantUnion : public TIntermTyped
: TIntermTyped(type), : TIntermTyped(type),
mUnionArrayPointer(unionPointer) { } mUnionArrayPointer(unionPointer) { }
virtual bool hasSideEffects() const { return false; } bool hasSideEffects() const override { return false; }
const TConstantUnion *getUnionArrayPointer() const { return mUnionArrayPointer; } const TConstantUnion *getUnionArrayPointer() const { return mUnionArrayPointer; }
TConstantUnion *getUnionArrayPointer() { return mUnionArrayPointer; } TConstantUnion *getUnionArrayPointer() { return mUnionArrayPointer; }
...@@ -295,9 +295,9 @@ class TIntermConstantUnion : public TIntermTyped ...@@ -295,9 +295,9 @@ class TIntermConstantUnion : public TIntermTyped
mUnionArrayPointer = safeConstantUnion; mUnionArrayPointer = safeConstantUnion;
} }
virtual TIntermConstantUnion *getAsConstantUnion() { return this; } TIntermConstantUnion *getAsConstantUnion() override { return this; }
void traverse(TIntermTraverser *it) override; void traverse(TIntermTraverser *it) override;
virtual bool replaceChildNode(TIntermNode *, TIntermNode *) { return false; } bool replaceChildNode(TIntermNode *, TIntermNode *) override { return false; }
TConstantUnion *foldBinary(TOperator op, TIntermConstantUnion *rightNode, TInfoSink &infoSink); TConstantUnion *foldBinary(TOperator op, TIntermConstantUnion *rightNode, TInfoSink &infoSink);
TConstantUnion *foldUnaryWithDifferentReturnType(TOperator op, TInfoSink &infoSink); TConstantUnion *foldUnaryWithDifferentReturnType(TOperator op, TInfoSink &infoSink);
...@@ -326,7 +326,7 @@ class TIntermOperator : public TIntermTyped ...@@ -326,7 +326,7 @@ class TIntermOperator : public TIntermTyped
bool isMultiplication() const; bool isMultiplication() const;
bool isConstructor() const; bool isConstructor() const;
virtual bool hasSideEffects() const { return isAssignment(); } bool hasSideEffects() const override { return isAssignment(); }
protected: protected:
TIntermOperator(TOperator op) TIntermOperator(TOperator op)
...@@ -349,12 +349,12 @@ class TIntermBinary : public TIntermOperator ...@@ -349,12 +349,12 @@ class TIntermBinary : public TIntermOperator
: TIntermOperator(op), : TIntermOperator(op),
mAddIndexClamp(false) {} mAddIndexClamp(false) {}
virtual TIntermBinary *getAsBinaryNode() { return this; } TIntermBinary *getAsBinaryNode() override { return this; };
void traverse(TIntermTraverser *it) override; void traverse(TIntermTraverser *it) override;
virtual bool replaceChildNode( bool replaceChildNode(
TIntermNode *original, TIntermNode *replacement); TIntermNode *original, TIntermNode *replacement) override;
virtual bool hasSideEffects() const bool hasSideEffects() const override
{ {
return isAssignment() || mLeft->hasSideEffects() || mRight->hasSideEffects(); return isAssignment() || mLeft->hasSideEffects() || mRight->hasSideEffects();
} }
...@@ -393,11 +393,11 @@ class TIntermUnary : public TIntermOperator ...@@ -393,11 +393,11 @@ class TIntermUnary : public TIntermOperator
mUseEmulatedFunction(false) {} mUseEmulatedFunction(false) {}
void traverse(TIntermTraverser *it) override; void traverse(TIntermTraverser *it) override;
virtual TIntermUnary *getAsUnaryNode() { return this; } TIntermUnary *getAsUnaryNode() override { return this; }
virtual bool replaceChildNode( bool replaceChildNode(
TIntermNode *original, TIntermNode *replacement); TIntermNode *original, TIntermNode *replacement) override;
virtual bool hasSideEffects() const bool hasSideEffects() const override
{ {
return isAssignment() || mOperand->hasSideEffects(); return isAssignment() || mOperand->hasSideEffects();
} }
...@@ -442,14 +442,14 @@ class TIntermAggregate : public TIntermOperator ...@@ -442,14 +442,14 @@ class TIntermAggregate : public TIntermOperator
} }
~TIntermAggregate() { } ~TIntermAggregate() { }
virtual TIntermAggregate *getAsAggregate() { return this; } TIntermAggregate *getAsAggregate() override { return this; }
void traverse(TIntermTraverser *it) override; void traverse(TIntermTraverser *it) override;
virtual bool replaceChildNode( bool replaceChildNode(
TIntermNode *original, TIntermNode *replacement); TIntermNode *original, TIntermNode *replacement) override;
bool replaceChildNodeWithMultiple(TIntermNode *original, TIntermSequence replacements); bool replaceChildNodeWithMultiple(TIntermNode *original, TIntermSequence replacements);
bool insertChildNodes(TIntermSequence::size_type position, TIntermSequence insertions); bool insertChildNodes(TIntermSequence::size_type position, TIntermSequence insertions);
// Conservatively assume function calls and other aggregate operators have side-effects // Conservatively assume function calls and other aggregate operators have side-effects
virtual bool hasSideEffects() const { return true; } bool hasSideEffects() const override { return true; }
TIntermTyped *fold(TInfoSink &infoSink); TIntermTyped *fold(TInfoSink &infoSink);
TIntermSequence *getSequence() { return &mSequence; } TIntermSequence *getSequence() { return &mSequence; }
...@@ -514,17 +514,17 @@ class TIntermSelection : public TIntermTyped ...@@ -514,17 +514,17 @@ class TIntermSelection : public TIntermTyped
mFalseBlock(falseB) {} mFalseBlock(falseB) {}
void traverse(TIntermTraverser *it) override; void traverse(TIntermTraverser *it) override;
virtual bool replaceChildNode( bool replaceChildNode(
TIntermNode *original, TIntermNode *replacement); TIntermNode *original, TIntermNode *replacement) override;
// Conservatively assume selections have side-effects // Conservatively assume selections have side-effects
virtual bool hasSideEffects() const { return true; } bool hasSideEffects() const override { return true; }
bool usesTernaryOperator() const { return getBasicType() != EbtVoid; } bool usesTernaryOperator() const { return getBasicType() != EbtVoid; }
TIntermNode *getCondition() const { return mCondition; } TIntermNode *getCondition() const { return mCondition; }
TIntermNode *getTrueBlock() const { return mTrueBlock; } TIntermNode *getTrueBlock() const { return mTrueBlock; }
TIntermNode *getFalseBlock() const { return mFalseBlock; } TIntermNode *getFalseBlock() const { return mFalseBlock; }
TIntermSelection *getAsSelectionNode() { return this; } TIntermSelection *getAsSelectionNode() override { return this; }
protected: protected:
TIntermTyped *mCondition; TIntermTyped *mCondition;
...@@ -847,12 +847,12 @@ class TMaxDepthTraverser : public TIntermTraverser ...@@ -847,12 +847,12 @@ class TMaxDepthTraverser : public TIntermTraverser
: TIntermTraverser(true, true, false), : TIntermTraverser(true, true, false),
mDepthLimit(depthLimit) { } mDepthLimit(depthLimit) { }
virtual bool visitBinary(Visit, TIntermBinary *) { return depthCheck(); } bool visitBinary(Visit, TIntermBinary *) override { return depthCheck(); }
virtual bool visitUnary(Visit, TIntermUnary *) { return depthCheck(); } bool visitUnary(Visit, TIntermUnary *) override { return depthCheck(); }
virtual bool visitSelection(Visit, TIntermSelection *) { return depthCheck(); } bool visitSelection(Visit, TIntermSelection *) override { return depthCheck(); }
virtual bool visitAggregate(Visit, TIntermAggregate *) { return depthCheck(); } bool visitAggregate(Visit, TIntermAggregate *) override { return depthCheck(); }
virtual bool visitLoop(Visit, TIntermLoop *) { return depthCheck(); } bool visitLoop(Visit, TIntermLoop *) override { return depthCheck(); }
virtual bool visitBranch(Visit, TIntermBranch *) { return depthCheck(); } bool visitBranch(Visit, TIntermBranch *) override { return depthCheck(); }
protected: protected:
bool depthCheck() const { return mMaxDepth < mDepthLimit; } bool depthCheck() const { return mMaxDepth < mDepthLimit; }
......
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