1 // 2 // Copyright 2017 The ANGLE Project Authors. All rights reserved. 3 // Use of this source code is governed by a BSD-style license that can be 4 // found in the LICENSE file. 5 // 6 // SymbolUniqueId.cpp: Encapsulates a unique id for a symbol. 7 8 #include "compiler/translator/SymbolUniqueId.h" 9 10 #include "compiler/translator/SymbolTable.h" 11 12 namespace sh 13 { 14 TSymbolUniqueId(TSymbolTable * symbolTable)15TSymbolUniqueId::TSymbolUniqueId(TSymbolTable *symbolTable) : mId(symbolTable->nextUniqueIdValue()) 16 {} 17 TSymbolUniqueId(const TSymbol & symbol)18TSymbolUniqueId::TSymbolUniqueId(const TSymbol &symbol) : mId(symbol.uniqueId().get()) {} 19 20 TSymbolUniqueId &TSymbolUniqueId::operator=(const TSymbolUniqueId &) = default; 21 operator ==(const TSymbolUniqueId & other) const22bool TSymbolUniqueId::operator==(const TSymbolUniqueId &other) const 23 { 24 return mId == other.mId; 25 } 26 27 } // namespace sh 28