mirror of
https://github.com/RPCS3/glslang.git
synced 2024-11-24 11:50:06 +00:00
HLSL: Non-functional: the symbol field of a token was in practice unused; remove it.
Another precurser to getting member non-static functions working.
This commit is contained in:
parent
5a8390696d
commit
f4ba25e009
@ -2,5 +2,5 @@
|
||||
// For the version, it uses the latest git tag followed by the number of commits.
|
||||
// For the date, it uses the current date (when then script is run).
|
||||
|
||||
#define GLSLANG_REVISION "Overload400-PrecQual.1922"
|
||||
#define GLSLANG_DATE "19-Mar-2017"
|
||||
#define GLSLANG_REVISION "Overload400-PrecQual.1923"
|
||||
#define GLSLANG_DATE "21-Mar-2017"
|
||||
|
@ -109,7 +109,6 @@ bool HlslGrammar::acceptIdentifier(HlslToken& idToken)
|
||||
|
||||
token.string = idString;
|
||||
token.tokenClass = EHTokIdentifier;
|
||||
token.symbol = nullptr;
|
||||
idToken = token;
|
||||
|
||||
advanceToken();
|
||||
@ -1298,8 +1297,7 @@ bool HlslGrammar::acceptType(TType& type, TIntermNode*& nodeList)
|
||||
// An identifier could be for a user-defined type.
|
||||
// Note we cache the symbol table lookup, to save for a later rule
|
||||
// when this is not a type.
|
||||
token.symbol = parseContext.lookupUserType(*token.string, type);
|
||||
if (token.symbol != nullptr) {
|
||||
if (parseContext.lookupUserType(*token.string, type) != nullptr) {
|
||||
advanceToken();
|
||||
return true;
|
||||
} else
|
||||
@ -2650,7 +2648,7 @@ bool HlslGrammar::acceptPostfixExpression(TIntermTyped*& node)
|
||||
return false;
|
||||
}
|
||||
} else if (! peekTokenClass(EHTokLeftParen)) {
|
||||
node = parseContext.handleVariable(idToken.loc, idToken.symbol, idToken.string);
|
||||
node = parseContext.handleVariable(idToken.loc, idToken.string);
|
||||
} else if (acceptFunctionCall(idToken, node)) {
|
||||
// function_call (nothing else to do yet)
|
||||
} else {
|
||||
|
@ -601,10 +601,9 @@ int HlslParseContext::getMatrixComponentsColumn(int rows, const TSwizzleSelector
|
||||
//
|
||||
// Handle seeing a variable identifier in the grammar.
|
||||
//
|
||||
TIntermTyped* HlslParseContext::handleVariable(const TSourceLoc& loc, TSymbol* symbol, const TString* string)
|
||||
TIntermTyped* HlslParseContext::handleVariable(const TSourceLoc& loc, const TString* string)
|
||||
{
|
||||
if (symbol == nullptr)
|
||||
symbol = symbolTable.find(*string);
|
||||
TSymbol* symbol = symbolTable.find(*string);
|
||||
if (symbol && symbol->getAsVariable() && symbol->getAsVariable()->isUserType()) {
|
||||
error(loc, "expected symbol, not user-defined type", string->c_str(), "");
|
||||
return nullptr;
|
||||
|
@ -62,7 +62,7 @@ public:
|
||||
bool builtInName(const TString&);
|
||||
|
||||
void handlePragma(const TSourceLoc&, const TVector<TString>&) override;
|
||||
TIntermTyped* handleVariable(const TSourceLoc&, TSymbol* symbol, const TString* string);
|
||||
TIntermTyped* handleVariable(const TSourceLoc&, const TString* string);
|
||||
TIntermTyped* handleBracketDereference(const TSourceLoc&, TIntermTyped* base, TIntermTyped* index);
|
||||
TIntermTyped* handleBracketOperator(const TSourceLoc&, TIntermTyped* base, TIntermTyped* index);
|
||||
void checkIndex(const TSourceLoc&, const TType&, int& index);
|
||||
|
@ -54,7 +54,7 @@ class TPpToken;
|
||||
// Everything needed to fully describe a token.
|
||||
//
|
||||
struct HlslToken {
|
||||
HlslToken() : string(nullptr), symbol(nullptr) { loc.init(); }
|
||||
HlslToken() : string(nullptr) { loc.init(); }
|
||||
TSourceLoc loc; // location of token in the source
|
||||
EHlslTokenClass tokenClass; // what kind of token it is
|
||||
union { // what data the token holds
|
||||
@ -64,7 +64,6 @@ struct HlslToken {
|
||||
bool b;
|
||||
double d;
|
||||
};
|
||||
glslang::TSymbol* symbol; // if a symbol-table lookup was done already, this is the result
|
||||
};
|
||||
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user