Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(785)

Unified Diff: src/asmjs/asm-typer.cc

Issue 2457393003: Thread decls-list through Declaration (Closed)
Patch Set: rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/asmjs/asm-wasm-builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/asmjs/asm-typer.cc
diff --git a/src/asmjs/asm-typer.cc b/src/asmjs/asm-typer.cc
index 6640bbab6b67fce0fc2b81f07a72e9f4ed980884..ddc5911782c155c429079f07498a91fdf12d5354 100644
--- a/src/asmjs/asm-typer.cc
+++ b/src/asmjs/asm-typer.cc
@@ -647,11 +647,8 @@ AsmType* AsmTyper::ValidateModule(FunctionLiteral* fun) {
FAIL(current, "Invalid top-level statement in asm.js module.");
}
- ZoneList<Declaration*>* decls = scope->declarations();
-
- for (int ii = 0; ii < decls->length(); ++ii) {
- Declaration* decl = decls->at(ii);
-
+ Declaration::List* decls = scope->declarations();
+ for (Declaration* decl : *decls) {
if (FunctionDeclaration* fun_decl = decl->AsFunctionDeclaration()) {
RECURSE(ValidateFunction(fun_decl));
source_layout.AddFunction(*fun_decl);
@@ -664,9 +661,7 @@ AsmType* AsmTyper::ValidateModule(FunctionLiteral* fun) {
source_layout.AddTable(*function_table);
}
- for (int ii = 0; ii < decls->length(); ++ii) {
- Declaration* decl = decls->at(ii);
-
+ for (Declaration* decl : *decls) {
if (decl->IsFunctionDeclaration()) {
continue;
}
@@ -1161,7 +1156,7 @@ AsmType* AsmTyper::ValidateFunction(FunctionDeclaration* fun_decl) {
DCHECK(return_type_->IsReturnType());
- for (auto* decl : *fun->scope()->declarations()) {
+ for (Declaration* decl : *fun->scope()->declarations()) {
auto* var_decl = decl->AsVariableDeclaration();
if (var_decl == nullptr) {
FAIL(decl, "Functions may only define inner variables.");
« no previous file with comments | « no previous file | src/asmjs/asm-wasm-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698