Track things like "(3)" and "+3" as expressions, not literals.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25511 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2014-02-24 21:16:19 +00:00
parent 35f04bde8a
commit b35e9bfa21
6 changed files with 36 additions and 20 deletions

View file

@ -502,6 +502,7 @@ public:
virtual TIntermTyped* fold(TOperator, const TIntermTyped*) const;
virtual TIntermTyped* fold(TOperator, const TType&) const;
void setLiteral() { literal = true; }
void setExpression() { literal = false; }
bool isLiteral() const { return literal; }
protected:
const TConstUnionArray unionArray;

View file

@ -9,5 +9,5 @@
// source have to figure out how to create revision.h just to get a build
// going. However, if it is not updated, it can be a version behind.
#define GLSLANG_REVISION "25408"
#define GLSLANG_DATE "2014/02/18 18:00:58"
#define GLSLANG_REVISION "25411"
#define GLSLANG_DATE "2014/02/18 19:47:20"

View file

@ -4096,7 +4096,7 @@ void TParseContext::fixBlockXfbOffsets(TSourceLoc loc, TQualifier& qualifier, TT
{
// "If a block is qualified with xfb_offset, all its
// members are assigned transform feedback buffer offsets. If a block is not qualified with xfb_offset, any
// members of that block not qualified with an xfb_offsetwill not be assigned transform feedback buffer
// members of that block not qualified with an xfb_offset will not be assigned transform feedback buffer
// offsets."
if (! qualifier.hasXfbBuffer() || ! qualifier.hasXfbOffset())

View file

@ -253,7 +253,9 @@ primary_expression
$$ = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtBool, EvqConst), $1.loc, true);
}
| LEFT_PAREN expression RIGHT_PAREN {
$$ = $2;
$$ = $2;
if ($$->getAsConstantUnion())
$$->getAsConstantUnion()->setExpression();
}
;
@ -430,8 +432,11 @@ unary_expression
parseContext.unaryOpError($1.loc, errorOp, $2->getCompleteString());
$$ = $2;
}
} else
} else {
$$ = $2;
if ($$->getAsConstantUnion())
$$->getAsConstantUnion()->setExpression();
}
}
;
// Grammar Note: No traditional style type casts.