Commit 78016eff by John Kessenich

Small tweak to switch statements: use a smaller base class.

parent b49a1915
...@@ -566,7 +566,7 @@ protected: ...@@ -566,7 +566,7 @@ protected:
// in between (if any) consecutive case/defaults. So, a traversal need only deal with // in between (if any) consecutive case/defaults. So, a traversal need only deal with
// 0 or 1 nodes per case/default statement. // 0 or 1 nodes per case/default statement.
// //
class TIntermSwitch : public TIntermAggregate { class TIntermSwitch : public TIntermNode {
public: public:
TIntermSwitch(TIntermTyped* cond, TIntermAggregate* b) : condition(cond), body(b) { } TIntermSwitch(TIntermTyped* cond, TIntermAggregate* b) : condition(cond), body(b) { }
virtual void traverse(TIntermTraverser*); virtual void traverse(TIntermTraverser*);
......
...@@ -1594,6 +1594,8 @@ void TParseContext::wrapupSwitchSubsequence(TIntermAggregate* statements, TInter ...@@ -1594,6 +1594,8 @@ void TParseContext::wrapupSwitchSubsequence(TIntermAggregate* statements, TInter
} }
if (branchNode) if (branchNode)
switchSequence->push_back(branchNode); switchSequence->push_back(branchNode);
// TODO: semantics: verify no duplicated case values
} }
// //
......
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