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 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).
 | 
					// For the date, it uses the current date (when then script is run).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define GLSLANG_REVISION "Overload400-PrecQual.1922"
 | 
					#define GLSLANG_REVISION "Overload400-PrecQual.1923"
 | 
				
			||||||
#define GLSLANG_DATE "19-Mar-2017"
 | 
					#define GLSLANG_DATE "21-Mar-2017"
 | 
				
			||||||
 | 
				
			|||||||
@ -109,7 +109,6 @@ bool HlslGrammar::acceptIdentifier(HlslToken& idToken)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    token.string     = idString;
 | 
					    token.string     = idString;
 | 
				
			||||||
    token.tokenClass = EHTokIdentifier;
 | 
					    token.tokenClass = EHTokIdentifier;
 | 
				
			||||||
    token.symbol     = nullptr;
 | 
					 | 
				
			||||||
    idToken          = token;
 | 
					    idToken          = token;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    advanceToken();
 | 
					    advanceToken();
 | 
				
			||||||
@ -1298,8 +1297,7 @@ bool HlslGrammar::acceptType(TType& type, TIntermNode*& nodeList)
 | 
				
			|||||||
        // An identifier could be for a user-defined type.
 | 
					        // An identifier could be for a user-defined type.
 | 
				
			||||||
        // Note we cache the symbol table lookup, to save for a later rule
 | 
					        // Note we cache the symbol table lookup, to save for a later rule
 | 
				
			||||||
        // when this is not a type.
 | 
					        // when this is not a type.
 | 
				
			||||||
        token.symbol = parseContext.lookupUserType(*token.string, type);
 | 
					        if (parseContext.lookupUserType(*token.string, type) != nullptr) {
 | 
				
			||||||
        if (token.symbol != nullptr) {
 | 
					 | 
				
			||||||
            advanceToken();
 | 
					            advanceToken();
 | 
				
			||||||
            return true;
 | 
					            return true;
 | 
				
			||||||
        } else
 | 
					        } else
 | 
				
			||||||
@ -2650,7 +2648,7 @@ bool HlslGrammar::acceptPostfixExpression(TIntermTyped*& node)
 | 
				
			|||||||
                return false;
 | 
					                return false;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        } else if (! peekTokenClass(EHTokLeftParen)) {
 | 
					        } 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)) {
 | 
					        } else if (acceptFunctionCall(idToken, node)) {
 | 
				
			||||||
            // function_call (nothing else to do yet)
 | 
					            // function_call (nothing else to do yet)
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
 | 
				
			|||||||
@ -601,10 +601,9 @@ int HlslParseContext::getMatrixComponentsColumn(int rows, const TSwizzleSelector
 | 
				
			|||||||
//
 | 
					//
 | 
				
			||||||
// Handle seeing a variable identifier in the grammar.
 | 
					// 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)
 | 
					    TSymbol* symbol = symbolTable.find(*string);
 | 
				
			||||||
        symbol = symbolTable.find(*string);
 | 
					 | 
				
			||||||
    if (symbol && symbol->getAsVariable() && symbol->getAsVariable()->isUserType()) {
 | 
					    if (symbol && symbol->getAsVariable() && symbol->getAsVariable()->isUserType()) {
 | 
				
			||||||
        error(loc, "expected symbol, not user-defined type", string->c_str(), "");
 | 
					        error(loc, "expected symbol, not user-defined type", string->c_str(), "");
 | 
				
			||||||
        return nullptr;
 | 
					        return nullptr;
 | 
				
			||||||
 | 
				
			|||||||
@ -62,7 +62,7 @@ public:
 | 
				
			|||||||
    bool builtInName(const TString&);
 | 
					    bool builtInName(const TString&);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void handlePragma(const TSourceLoc&, const TVector<TString>&) override;
 | 
					    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* handleBracketDereference(const TSourceLoc&, TIntermTyped* base, TIntermTyped* index);
 | 
				
			||||||
    TIntermTyped* handleBracketOperator(const TSourceLoc&, TIntermTyped* base, TIntermTyped* index);
 | 
					    TIntermTyped* handleBracketOperator(const TSourceLoc&, TIntermTyped* base, TIntermTyped* index);
 | 
				
			||||||
    void checkIndex(const TSourceLoc&, const TType&, int& index);
 | 
					    void checkIndex(const TSourceLoc&, const TType&, int& index);
 | 
				
			||||||
 | 
				
			|||||||
@ -54,7 +54,7 @@ class TPpToken;
 | 
				
			|||||||
// Everything needed to fully describe a token.
 | 
					// Everything needed to fully describe a token.
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
struct HlslToken {
 | 
					struct HlslToken {
 | 
				
			||||||
    HlslToken() : string(nullptr), symbol(nullptr) { loc.init(); }
 | 
					    HlslToken() : string(nullptr) { loc.init(); }
 | 
				
			||||||
    TSourceLoc loc;                // location of token in the source
 | 
					    TSourceLoc loc;                // location of token in the source
 | 
				
			||||||
    EHlslTokenClass tokenClass;    // what kind of token it is
 | 
					    EHlslTokenClass tokenClass;    // what kind of token it is
 | 
				
			||||||
    union {                        // what data the token holds
 | 
					    union {                        // what data the token holds
 | 
				
			||||||
@ -64,7 +64,6 @@ struct HlslToken {
 | 
				
			|||||||
        bool b;
 | 
					        bool b;
 | 
				
			||||||
        double d;
 | 
					        double d;
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
    glslang::TSymbol* symbol;      // if a symbol-table lookup was done already, this is the result
 | 
					 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user