summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/angle/src/compiler/translator/ValidateSwitch.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/angle/src/compiler/translator/ValidateSwitch.h')
-rw-r--r--src/3rdparty/angle/src/compiler/translator/ValidateSwitch.h52
1 files changed, 14 insertions, 38 deletions
diff --git a/src/3rdparty/angle/src/compiler/translator/ValidateSwitch.h b/src/3rdparty/angle/src/compiler/translator/ValidateSwitch.h
index ddbefc5619..2d2dd70f78 100644
--- a/src/3rdparty/angle/src/compiler/translator/ValidateSwitch.h
+++ b/src/3rdparty/angle/src/compiler/translator/ValidateSwitch.h
@@ -7,46 +7,22 @@
#ifndef COMPILER_TRANSLATOR_VALIDATESWITCH_H_
#define COMPILER_TRANSLATOR_VALIDATESWITCH_H_
-#include "compiler/translator/IntermNode.h"
+#include "compiler/translator/BaseTypes.h"
+#include "compiler/translator/Common.h"
-class TParseContext;
-
-class ValidateSwitch : public TIntermTraverser
+namespace sh
{
- public:
- // Check for errors and output messages any remaining errors on the context.
- // Returns true if there are no errors.
- static bool validate(TBasicType switchType, TParseContext *context,
- TIntermAggregate *statementList, const TSourceLoc &loc);
-
- void visitSymbol(TIntermSymbol *) override;
- void visitConstantUnion(TIntermConstantUnion *) override;
- bool visitBinary(Visit, TIntermBinary *) override;
- bool visitUnary(Visit, TIntermUnary *) override;
- bool visitSelection(Visit visit, TIntermSelection *) override;
- bool visitSwitch(Visit, TIntermSwitch *) override;
- bool visitCase(Visit, TIntermCase *node) override;
- bool visitAggregate(Visit, TIntermAggregate *) override;
- bool visitLoop(Visit visit, TIntermLoop *) override;
- bool visitBranch(Visit, TIntermBranch *) override;
-
- private:
- ValidateSwitch(TBasicType switchType, TParseContext *context);
+class TDiagnostics;
+class TIntermBlock;
- bool validateInternal(const TSourceLoc &loc);
+// Check for errors and output error messages on the context.
+// Returns true if there are no errors.
+bool ValidateSwitchStatementList(TBasicType switchType,
+ int shaderVersion,
+ TDiagnostics *diagnostics,
+ TIntermBlock *statementList,
+ const TSourceLoc &loc);
- TBasicType mSwitchType;
- TParseContext *mContext;
- bool mCaseTypeMismatch;
- bool mFirstCaseFound;
- bool mStatementBeforeCase;
- bool mLastStatementWasCase;
- int mControlFlowDepth;
- bool mCaseInsideControlFlow;
- int mDefaultCount;
- std::set<int> mCasesSigned;
- std::set<unsigned int> mCasesUnsigned;
- bool mDuplicateCases;
-};
+} // namespace sh
-#endif // COMPILER_TRANSLATOR_VALIDATESWITCH_H_
+#endif // COMPILER_TRANSLATOR_VALIDATESWITCH_H_