Remove fRootSymbolTable from IR Generator

Two Compiler methods that use the root symbol table are still dangerous,
they're polluting the global namespace. For long-lived compilers, we
don't want to do that. takeOwnership is only used in tests, but
registerExternalValue is used by particles. Thinking I'll move that to
an optional argument to convertProgram, or a field on Settings.

Change-Id: Ic88d29d053510001931dcc2388aba2dc83a953ea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319030
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
diff --git a/src/sksl/SkSLCompiler.cpp b/src/sksl/SkSLCompiler.cpp
index 0dde6ca..8deb632 100644
--- a/src/sksl/SkSLCompiler.cpp
+++ b/src/sksl/SkSLCompiler.cpp
@@ -1565,11 +1565,11 @@
 }
 
 void Compiler::registerExternalValue(ExternalValue* value) {
-    fIRGenerator->fRootSymbolTable->addWithoutOwnership(value->fName, value);
+    fRootSymbolTable->addWithoutOwnership(value->fName, value);
 }
 
 const Symbol* Compiler::takeOwnership(std::unique_ptr<const Symbol> symbol) {
-    return fIRGenerator->fRootSymbolTable->takeOwnershipOfSymbol(std::move(symbol));
+    return fRootSymbolTable->takeOwnershipOfSymbol(std::move(symbol));
 }
 
 std::unique_ptr<Program> Compiler::convertProgram(Program::Kind kind, String text,
diff --git a/src/sksl/SkSLIRGenerator.cpp b/src/sksl/SkSLIRGenerator.cpp
index 9a18451..18440dc 100644
--- a/src/sksl/SkSLIRGenerator.cpp
+++ b/src/sksl/SkSLIRGenerator.cpp
@@ -125,7 +125,6 @@
         : fContext(*context)
         , fInliner(inliner)
         , fCurrentFunction(nullptr)
-        , fRootSymbolTable(symbolTable)
         , fSymbolTable(symbolTable)
         , fLoopLevel(0)
         , fSwitchLevel(0)
diff --git a/src/sksl/SkSLIRGenerator.h b/src/sksl/SkSLIRGenerator.h
index 5017fbe..6db7dfe 100644
--- a/src/sksl/SkSLIRGenerator.h
+++ b/src/sksl/SkSLIRGenerator.h
@@ -204,7 +204,6 @@
     std::unique_ptr<ASTFile> fFile;
     const FunctionDeclaration* fCurrentFunction;
     std::unordered_map<String, Program::Settings::Value> fCapsMap;
-    std::shared_ptr<SymbolTable> fRootSymbolTable;
     std::shared_ptr<SymbolTable> fSymbolTable;
     // additional statements that need to be inserted before the one that convertStatement is
     // currently working on