// // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2013 LunarG, Inc. // Copyright (C) 2017 ARM Limited. // Copyright (C) 2015-2018 Google, Inc. // Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // // Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following // disclaimer in the documentation and/or other materials provided // with the distribution. // // Neither the name of 3Dlabs Inc. Ltd. nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE // COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // // Symbol table for parsing. Most functionality and main ideas // are documented in the header file. // #include "SymbolTable.h" namespace glslang { // // TType helper function needs a place to live. // // // Recursively generate mangled names. // void TType::buildMangledName(TString& mangledName) const { … } // // Dump functions. // void TSymbol::dumpExtensions(TInfoSink& infoSink) const { … } void TVariable::dump(TInfoSink& infoSink, bool complete) const { … } void TFunction::dump(TInfoSink& infoSink, bool complete) const { … } void TAnonMember::dump(TInfoSink& TInfoSink, bool) const { … } void TSymbolTableLevel::dump(TInfoSink& infoSink, bool complete) const { … } void TSymbolTable::dump(TInfoSink& infoSink, bool complete) const { … } // // Functions have buried pointers to delete. // TFunction::~TFunction() { … } // // Symbol table levels are a map of pointers to symbols that have to be deleted. // TSymbolTableLevel::~TSymbolTableLevel() { … } // // Change all function entries in the table with the non-mangled name // to be related to the provided built-in operation. // void TSymbolTableLevel::relateToOperator(const char* name, TOperator op) { … } // Make all function overloads of the given name require an extension(s). // Should only be used for a version/profile that actually needs the extension(s). void TSymbolTableLevel::setFunctionExtensions(const char* name, int num, const char* const extensions[]) { … } // Make a single function require an extension(s). i.e., this will only set the extensions for the symbol that matches 'name' exactly. // This is different from setFunctionExtensions, which uses std::map::lower_bound to effectively set all symbols that start with 'name'. // Should only be used for a version/profile that actually needs the extension(s). void TSymbolTableLevel::setSingleFunctionExtensions(const char* name, int num, const char* const extensions[]) { … } // // Make all symbols in this table level read only. // void TSymbolTableLevel::readOnly() { … } // // Copy a symbol, but the copy is writable; call readOnly() afterward if that's not desired. // TSymbol::TSymbol(const TSymbol& copyOf) { … } TVariable::TVariable(const TVariable& copyOf) : … { … } TVariable* TVariable::clone() const { … } TFunction::TFunction(const TFunction& copyOf) : … { … } TFunction* TFunction::clone() const { … } TAnonMember* TAnonMember::clone() const { … } TSymbolTableLevel* TSymbolTableLevel::clone() const { … } void TSymbolTable::copyTable(const TSymbolTable& copyOf) { … } } // end namespace glslang