Home | History | Annotate | Download | only in hlsl

Lines Matching refs:symbol

286 TIntermTyped* HlslParseContext::handleVariable(const TSourceLoc& loc, TSymbol* symbol, const TString* string)
288 if (symbol == nullptr)
289 symbol = symbolTable.find(*string);
290 if (symbol && symbol->getAsVariable() && symbol->getAsVariable()->isUserType()) {
291 error(loc, "expected symbol, not user-defined type", string->c_str(), "");
296 if (symbol && symbol->getNumExtensions())
297 requireExtensions(loc, symbol->getNumExtensions(), symbol->getExtensions(), symbol->getName().c_str());
299 if (symbol && symbol->isReadOnly()) {
308 if (symbol->getType().containsImplicitlySizedArray() || (symbol->getAsAnonMember() && symbol->getAsAnonMember()->getAnonContainer().getType().containsImplicitlySizedArray()))
309 makeEditable(symbol);
313 const TAnonMember* anon = symbol ? symbol->getAsAnonMember() : nullptr;
330 // The symbol table search was done in the lexical phase.
332 variable = symbol ? symbol->getAsVariable() : nullptr;
340 if (symbol)
417 // Make a shared symbol have a non-shared version that can be edited by the current
420 void HlslParseContext::makeEditable(TSymbol*& symbol)
423 symbol = symbolTable.copyUp(symbol);
426 if (isIoResizeArray(symbol->getType()))
427 ioArraySymbolResizeList.push_back(symbol);
430 intermediate.addSymbolLinkageNode(linkage, *symbol);
436 TSymbol* symbol = symbolTable.find(name, &builtIn);
438 makeEditable(symbol);
440 return symbol->getAsVariable();
492 // symbol table.
676 TSymbol* symbol = symbolTable.find(function.getMangledName(), &builtIn);
677 const TFunction* prevDec = symbol ? symbol->getAsFunction() : 0;
686 symbol->getAsFunction()->setPrototyped(); // need a writable one, but like having prevDec as a const
699 // being redeclared. So, pass back this declaration, not the one in the symbol table.
711 TSymbol* symbol = symbolTable.find(function.getMangledName());
712 TFunction* prevDec = symbol ? symbol->getAsFunction() : nullptr;
717 // as it would have just been put in the symbol table. Otherwise, we're looking up
741 // New symbol table scope for body of function plus its arguments
746 // Insert parameters into the symbol table.
759 // Insert the parameters with name in the symbol table.
763 // Transfer ownership of name pointer to symbol table.
1438 // Don't go through the symbol table for constructors.
1452 // Find it in the symbol table.
2054 // it was not found as a variable in the symbol table. If so, give the error
2055 // message and insert a dummy variable in the symbol table to prevent future errors.
2059 TIntermSymbol* symbol = nodePtr->getAsSymbolNode();
2060 if (! symbol)
2063 if (symbol->getType().getBasicType() == EbtVoid) {
2064 error(symbol->getLoc(), "undeclared identifier", symbol->getName().c_str(), "");
2066 // Add to symbol table to prevent future error messages on the same name
2067 if (symbol->getName().size() > 0) {
2068 TVariable* fakeVariable = new TVariable(&symbol->getName(), TType(EbtFloat));
2071 // substitute a symbol node for this new variable
2072 nodePtr = intermediate.addSymbol(*fakeVariable, symbol->getLoc());
2442 TIntermSymbol* symbol = expr->getAsSymbolNode();
2443 if (symbol && symbol->getConstArray().size() > 0)
2444 sizePair.size = symbol->getConstArray()[0].getIConst();
2494 // without a size, and make the right changes to the symbol table.
2496 void HlslParseContext::declareArray(const TSourceLoc& loc, TString& identifier, const TType& type, TSymbol*& symbol, bool& newDeclaration)
2498 if (! symbol) {
2500 symbol = symbolTable.find(identifier, nullptr, &currentScope);
2502 if (symbol && builtInName(identifier) && ! symbolTable.atBuiltInLevel()) {
2506 if (symbol == nullptr || ! currentScope) {
2511 symbol = new TVariable(&identifier, type);
2512 symbolTable.insert(*symbol);
2517 ioArraySymbolResizeList.push_back(symbol);
2520 fixIoArraySize(loc, symbol->getWritableType());
2525 if (symbol->getAsAnonMember()) {
2527 symbol = nullptr;
2536 if (! symbol) {
2542 TType& existingType = symbol->getWritableType();
2567 // Figure out what symbol to lookup, as we will use its type to edit for the size change,
2569 TSymbol* symbol = nullptr;
2591 // Lookup the symbol, should only fail if shader code is incorrect
2592 symbol = symbolTable.find(*lookupName);
2593 if (symbol == nullptr)
2596 if (symbol->getAsFunction()) {
2597 error(loc, "array variable name expected", symbol->getName().c_str(), "");
2601 symbol->getWritableType().setImplicitArraySize(index + 1);
2605 // See if the identifier is a built-in symbol that can be redeclared, and if so,
2606 // copy the symbol table's read-only built-in variable to the current
3164 // Look up a function name in the symbol table, and make sure it is a function.
3166 // Return the function symbol if found, otherwise nullptr.
3178 TSymbol* symbol = symbolTable.find(call.getMangledName(), &builtIn);
3179 if (symbol)
3180 return symbol->getAsFunction();
3236 // Do everything necessary to handle a typedef declaration, for a single symbol.
3258 // Either redeclaring a variable, or making a new one, updating the symbol
3282 bool newDeclaration = false; // true if a new entry gets added to the symbol table
3283 TSymbol* symbol = nullptr; // = redeclareBuiltinVariable(loc, identifier, type.getQualifier(), parseType.shaderQualifiers, newDeclaration);
3293 declareArray(loc, identifier, type, symbol, newDeclaration);
3296 if (! symbol)
3297 symbol = declareNonArray(loc, identifier, type, newDeclaration);
3298 else if (type != symbol->getType())
3299 error(loc, "cannot change the type of", "redeclaration", symbol->getName().c_str());
3302 if (! symbol)
3307 if (symbol && initializer) {
3308 TVariable* variable = symbol->getAsVariable();
3318 intermediate.addSymbolLinkageNode(linkage, *symbol);
3360 // add variable to symbol table
3849 // Use the symbol table to prevent normal reuse of the block's name, as a variable entry,
4028 TSymbol* symbol = symbolTable.find(identifier);
4029 if (! symbol) {
4033 if (symbol->getAsFunction()) {
4048 // For read-only built-ins, add a new symbol for holding the modified qualifier.
4050 if (symbol->isReadOnly())
4051 symbol = symbolTable.copyUp(symbol);
4056 symbol->getWritableType().getQualifier().invariant = true;
4060 symbol->getWritableType().getQualifier().noContraction = true;
4062 symbol->getWritableType().getQualifier().makeSpecConstant();
4064 symbol->getWritableType().getQualifier().layoutSpecConstantId = qualifier.layoutSpecConstantId;