From 52821472b93e551375b8df43cc1b8a7bfc18e8f5 Mon Sep 17 00:00:00 2001 From: juj Date: Tue, 21 Jun 2016 21:34:39 +0100 Subject: Build fixes/workarounds to support Visual Studio 2013 build, which has trouble with some new C++11 constructs. (#581) --- src/passes/CoalesceLocals.cpp | 4 ++-- src/passes/pass.cpp | 2 +- src/support/archive.cpp | 2 +- src/support/archive.h | 4 ++-- src/support/file.cpp | 1 + 5 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/passes/CoalesceLocals.cpp b/src/passes/CoalesceLocals.cpp index e2d11d697..fb1ef09cb 100644 --- a/src/passes/CoalesceLocals.cpp +++ b/src/passes/CoalesceLocals.cpp @@ -569,7 +569,7 @@ void CoalesceLocalsWithLearning::pickIndices(std::vector& indices) { #ifdef CFG_LEARN_DEBUG std::cout << "[learning for " << getFunction()->name << "]\n"; #endif - auto numVars = getFunction()->getNumVars(); + auto numVars = this->getFunction()->getNumVars(); const int GENERATION_SIZE = std::min(Index(numVars * (numVars - 1)), Index(20)); Generator generator(this); GeneticLearner learner(generator, GENERATION_SIZE); @@ -590,7 +590,7 @@ void CoalesceLocalsWithLearning::pickIndices(std::vector& indices) { #ifdef CFG_LEARN_DEBUG learner.getBest()->dump("the best"); #endif - pickIndicesFromOrder(*learner.getBest(), indices); // TODO: cache indices in Orders, at the cost of more memory? + this->pickIndicesFromOrder(*learner.getBest(), indices); // TODO: cache indices in Orders, at the cost of more memory? } // declare passes diff --git a/src/passes/pass.cpp b/src/passes/pass.cpp index 1c66147ef..35250cb8d 100644 --- a/src/passes/pass.cpp +++ b/src/passes/pass.cpp @@ -144,7 +144,7 @@ void PassRunner::run() { if (index >= numFunctions) { return ThreadWorkState::Finished; // nothing left } - Function* func = wasm->functions[index].get(); + Function* func = this->wasm->functions[index].get(); // do the current task: run all passes on this function for (auto* pass : stack) { runPassOnFunction(pass, func); diff --git a/src/support/archive.cpp b/src/support/archive.cpp index 126f4e2ce..487a77376 100644 --- a/src/support/archive.cpp +++ b/src/support/archive.cpp @@ -60,7 +60,7 @@ uint32_t ArchiveMemberHeader::getSize() const { return static_cast(sizeInt); } -Archive::Archive(Buffer& b, bool& error) : data(b) { +Archive::Archive(Buffer& b, bool& error) : data(b), symbolTable({nullptr, 0}), stringTable({nullptr, 0}) { error = false; if (data.size() < strlen(magic) || memcmp(data.data(), magic, strlen(magic))) { diff --git a/src/support/archive.h b/src/support/archive.h index 40fea2529..95af1ac94 100644 --- a/src/support/archive.h +++ b/src/support/archive.h @@ -97,8 +97,8 @@ class Archive { private: void setFirstRegular(const Child& c) { firstRegularData = c.data; } Buffer& data; - SubBuffer symbolTable = {nullptr, 0}; - SubBuffer stringTable = {nullptr, 0}; + SubBuffer symbolTable; + SubBuffer stringTable; const uint8_t* firstRegularData; }; diff --git a/src/support/file.cpp b/src/support/file.cpp index 59880e862..296fd6dbe 100644 --- a/src/support/file.cpp +++ b/src/support/file.cpp @@ -17,6 +17,7 @@ #include "support/file.h" #include +#include #include template -- cgit v1.2.3