Use accessors to refer to the ModifiersPool.
This is a first step towards moving the ModifiersPool out of the
IRGenerator and into the Context.
Change-Id: I8000923f32a9e3cc1878a09464680884b950e513
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/404216
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
diff --git a/src/sksl/SkSLRehydrator.cpp b/src/sksl/SkSLRehydrator.cpp
index 46adfc7..44fba39 100644
--- a/src/sksl/SkSLRehydrator.cpp
+++ b/src/sksl/SkSLRehydrator.cpp
@@ -78,11 +78,10 @@
};
Rehydrator::Rehydrator(const Context* context, ModifiersPool* modifiers,
- std::shared_ptr<SymbolTable> symbolTable, ErrorReporter* errorReporter,
+ std::shared_ptr<SymbolTable> symbolTable,
const uint8_t* src, size_t length)
: fContext(*context)
, fModifiers(*modifiers)
- , fErrors(errorReporter)
, fSymbolTable(std::move(symbolTable))
, fStart(src)
SkDEBUGCODE(, fEnd(fStart + length)) {
@@ -184,8 +183,12 @@
const Type* returnType = this->type();
const FunctionDeclaration* result =
fSymbolTable->takeOwnershipOfSymbol(std::make_unique<FunctionDeclaration>(
- /*offset=*/-1, fModifiers.addToPool(modifiers), name,
- std::move(parameters), returnType, /*builtin=*/true));
+ /*offset=*/-1,
+ this->modifiersPool().add(modifiers),
+ name,
+ std::move(parameters),
+ returnType,
+ /*builtin=*/true));
this->addSymbol(id, result);
return result;
}
@@ -252,7 +255,7 @@
}
case kVariable_Command: {
uint16_t id = this->readU16();
- const Modifiers* m = fModifiers.addToPool(this->modifiers());
+ const Modifiers* m = this->modifiersPool().add(this->modifiers());
StringFragment name = this->readString();
const Type* type = this->type();
Variable::Storage storage = (Variable::Storage) this->readU8();
@@ -585,7 +588,7 @@
std::shared_ptr<SymbolTable> oldTable = fSymbolTable;
std::shared_ptr<SymbolTable> result =
inherit ? std::make_shared<SymbolTable>(fSymbolTable, /*builtin=*/true)
- : std::make_shared<SymbolTable>(fErrors, /*builtin=*/true);
+ : std::make_shared<SymbolTable>(this->errorReporter(), /*builtin=*/true);
fSymbolTable = result;
std::vector<const Symbol*> ownedSymbols;
ownedSymbols.reserve(ownedCount);