Remove fExtraStatements/convertSingleStatement from IRGenerator.

These seem to be remnants of the old inliner.

Change-Id: I881127d056531a2a23e045ff8f3d8da52314fc6e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/384176
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This commit is contained in:
John Stiles 2021-03-12 09:25:04 -05:00 committed by Skia Commit-Bot
parent 39811680dc
commit 20c09f9290
2 changed files with 1 additions and 23 deletions

View File

@ -141,7 +141,7 @@ std::unique_ptr<ModifiersPool> IRGenerator::releaseModifiers() {
return result;
}
std::unique_ptr<Statement> IRGenerator::convertSingleStatement(const ASTNode& statement) {
std::unique_ptr<Statement> IRGenerator::convertStatement(const ASTNode& statement) {
switch (statement.fKind) {
case ASTNode::Kind::kBlock:
return this->convertBlock(statement);
@ -190,24 +190,6 @@ std::unique_ptr<Statement> IRGenerator::convertSingleStatement(const ASTNode& st
}
}
std::unique_ptr<Statement> IRGenerator::convertStatement(const ASTNode& statement) {
StatementArray oldExtraStatements = std::move(fExtraStatements);
std::unique_ptr<Statement> result = this->convertSingleStatement(statement);
if (!result) {
fExtraStatements = std::move(oldExtraStatements);
return nullptr;
}
if (fExtraStatements.size()) {
fExtraStatements.push_back(std::move(result));
auto block = std::make_unique<Block>(/*offset=*/-1, std::move(fExtraStatements),
/*symbols=*/nullptr, /*isScope=*/false);
fExtraStatements = std::move(oldExtraStatements);
return std::move(block);
}
fExtraStatements = std::move(oldExtraStatements);
return result;
}
std::unique_ptr<Block> IRGenerator::convertBlock(const ASTNode& block) {
SkASSERT(block.fKind == ASTNode::Kind::kBlock);
AutoSymbolTable table(this);

View File

@ -172,7 +172,6 @@ private:
Variable::Storage storage);
StatementArray convertVarDeclarations(const ASTNode& decl, Variable::Storage storage);
void convertFunction(const ASTNode& f);
std::unique_ptr<Statement> convertSingleStatement(const ASTNode& statement);
std::unique_ptr<Statement> convertStatement(const ASTNode& statement);
std::unique_ptr<Expression> convertExpression(const ASTNode& expression);
std::unique_ptr<ModifiersDeclaration> convertModifiersDeclaration(const ASTNode& m);
@ -255,9 +254,6 @@ private:
std::unique_ptr<ASTFile> fFile;
std::shared_ptr<SymbolTable> fSymbolTable = nullptr;
// additional statements that need to be inserted before the one that convertStatement is
// currently working on
StatementArray fExtraStatements;
// Symbols which have definitions in the include files.
IRIntrinsicMap* fIntrinsics = nullptr;
std::unordered_set<const FunctionDeclaration*> fReferencedIntrinsics;