summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2020-01-07 10:16:10 -0800
committerGitHub <noreply@github.com>2020-01-07 10:16:10 -0800
commitf73b40c7873dbd2dd46a962f3afe5b97a7fc8b0a (patch)
tree00cf4a6712fae15faad384c4c541100bdf012d5f /src
parent85de1c127d7d05966b4589d33718bbb70b961c24 (diff)
downloadbinaryen-f73b40c7873dbd2dd46a962f3afe5b97a7fc8b0a.tar.gz
binaryen-f73b40c7873dbd2dd46a962f3afe5b97a7fc8b0a.tar.bz2
binaryen-f73b40c7873dbd2dd46a962f3afe5b97a7fc8b0a.zip
[NFC] Clean up unnecessary `template`s in calls 🧹🧹🧹 (#2394)
Diffstat (limited to 'src')
-rw-r--r--src/passes/OptimizeAddedConstants.cpp8
-rw-r--r--src/tools/fuzzing.h6
-rw-r--r--src/wasm2js.h5
3 files changed, 9 insertions, 10 deletions
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<Const>()) {
+ if (auto* c = oneSide->dynCast<Const>()) {
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<Const>()) {
- if (otherSide->template is<Const>()) {
+ if (auto* c = oneSide->dynCast<Const>()) {
+ if (otherSide->is<Const>()) {
// 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<LocalGet>()) {
+ if (auto* get = otherSide->dynCast<LocalGet>()) {
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<Block>()) {
+ if (Block* block = curr->dynCast<Block>()) {
if (name == block->name) {
return true;
}
- } else if (Loop* loop = curr->template dynCast<Loop>()) {
+ } else if (Loop* loop = curr->dynCast<Loop>()) {
if (name == loop->name) {
return true;
}
} else {
// an if, ignorable
- assert(curr->template is<If>());
+ assert(curr->is<If>());
}
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<Const>()) {
- ;
+ if (auto* c = segment.offset->dynCast<Const>()) {
return std::to_string(c->value.getInteger());
}
- if (auto* get = segment.offset->template dynCast<GlobalGet>()) {
+ if (auto* get = segment.offset->dynCast<GlobalGet>()) {
auto internalName = get->name;
auto importedName = wasm.getGlobal(internalName)->base;
return accessGlobal(asmangle(importedName.str));