From f73b40c7873dbd2dd46a962f3afe5b97a7fc8b0a Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Tue, 7 Jan 2020 10:16:10 -0800 Subject: [NFC] Clean up unnecessary `template`s in calls 🧹🧹🧹 (#2394) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/passes/OptimizeAddedConstants.cpp | 8 ++++---- src/tools/fuzzing.h | 6 +++--- src/wasm2js.h | 5 ++--- 3 files changed, 9 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/passes/OptimizeAddedConstants.cpp b/src/passes/OptimizeAddedConstants.cpp index 8a72a0cd0..a34d1b96d 100644 --- a/src/passes/OptimizeAddedConstants.cpp +++ b/src/passes/OptimizeAddedConstants.cpp @@ -143,7 +143,7 @@ private: // success, the returned offset can be added as a replacement for the // expression here. bool tryToOptimizeConstant(Expression* oneSide, Expression* otherSide) { - if (auto* c = oneSide->template dynCast()) { + if (auto* c = oneSide->dynCast()) { auto result = canOptimizeConstant(c->value); if (result.succeeded) { curr->offset = result.total; @@ -161,8 +161,8 @@ private: Expression* otherSide, LocalGet* ptr, LocalSet* set) { - if (auto* c = oneSide->template dynCast()) { - if (otherSide->template is()) { + if (auto* c = oneSide->dynCast()) { + if (otherSide->is()) { // Both sides are constant - this is not optimized code, ignore. return false; } @@ -191,7 +191,7 @@ private: // dominates the load, and it is ok to replace x with y + 10 there. Index index = -1; bool canReuseIndex = false; - if (auto* get = otherSide->template dynCast()) { + if (auto* get = otherSide->dynCast()) { if (localGraph->isSSA(get->index) && localGraph->isSSA(ptr->index)) { index = get->index; canReuseIndex = true; diff --git a/src/tools/fuzzing.h b/src/tools/fuzzing.h index 7e46a8eea..af5773e80 100644 --- a/src/tools/fuzzing.h +++ b/src/tools/fuzzing.h @@ -766,17 +766,17 @@ private: Index i = controlFlowStack.size() - 1; while (1) { auto* curr = controlFlowStack[i]; - if (Block* block = curr->template dynCast()) { + if (Block* block = curr->dynCast()) { if (name == block->name) { return true; } - } else if (Loop* loop = curr->template dynCast()) { + } else if (Loop* loop = curr->dynCast()) { if (name == loop->name) { return true; } } else { // an if, ignorable - assert(curr->template is()); + assert(curr->is()); } if (i == 0) { return false; diff --git a/src/wasm2js.h b/src/wasm2js.h index 398b81f43..9f6c19338 100644 --- a/src/wasm2js.h +++ b/src/wasm2js.h @@ -2263,11 +2263,10 @@ void Wasm2JSGlue::emitMemory( out << "var " << segmentWriter << " = (" << expr << ")(" << buffer << ");\n"; auto globalOffset = [&](const Memory::Segment& segment) { - if (auto* c = segment.offset->template dynCast()) { - ; + if (auto* c = segment.offset->dynCast()) { return std::to_string(c->value.getInteger()); } - if (auto* get = segment.offset->template dynCast()) { + if (auto* get = segment.offset->dynCast()) { auto internalName = get->name; auto importedName = wasm.getGlobal(internalName)->base; return accessGlobal(asmangle(importedName.str)); -- cgit v1.2.3