diff options
Diffstat (limited to 'src/sksl/ir/SkSLSymbolTable.h')
-rw-r--r-- | src/sksl/ir/SkSLSymbolTable.h | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/sksl/ir/SkSLSymbolTable.h b/src/sksl/ir/SkSLSymbolTable.h index d732023ff0..151475d642 100644 --- a/src/sksl/ir/SkSLSymbolTable.h +++ b/src/sksl/ir/SkSLSymbolTable.h @@ -10,14 +10,12 @@ #include <memory> #include <unordered_map> -#include <vector> #include "SkSLErrorReporter.h" #include "SkSLSymbol.h" +#include "SkSLUnresolvedFunction.h" namespace SkSL { -struct FunctionDeclaration; - /** * Maps identifiers to symbols. Functions, in particular, are mapped to either FunctionDeclaration * or UnresolvedFunction depending on whether they are overloaded or not. @@ -31,22 +29,17 @@ public: : fParent(parent) , fErrorReporter(errorReporter) {} - const Symbol* operator[](const std::string& name); - - void add(const std::string& name, std::unique_ptr<Symbol> symbol); + std::shared_ptr<Symbol> operator[](const std::string& name); - void addWithoutOwnership(const std::string& name, const Symbol* symbol); - - Symbol* takeOwnership(Symbol* s); + void add(const std::string& name, std::shared_ptr<Symbol> symbol); const std::shared_ptr<SymbolTable> fParent; private: - static std::vector<const FunctionDeclaration*> GetFunctions(const Symbol& s); - - std::vector<std::unique_ptr<Symbol>> fOwnedPointers; + static std::vector<std::shared_ptr<FunctionDeclaration>> GetFunctions( + const std::shared_ptr<Symbol>& s); - std::unordered_map<std::string, const Symbol*> fSymbols; + std::unordered_map<std::string, std::shared_ptr<Symbol>> fSymbols; ErrorReporter& fErrorReporter; }; |