From db9124f1de0478dcac525009b6f1589b44a7edd8 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 26 Apr 2019 16:59:41 -0700 Subject: Apply format changes from #2048 (#2059) Mass change to apply clang-format to everything. We are applying this in a PR by me so the (git) blame is all mine ;) but @aheejin did all the work to get clang-format set up and all the manual work to tidy up some things to make the output nicer in #2048 --- src/passes/Strip.cpp | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'src/passes/Strip.cpp') diff --git a/src/passes/Strip.cpp b/src/passes/Strip.cpp index edc171ab3..e85379003 100644 --- a/src/passes/Strip.cpp +++ b/src/passes/Strip.cpp @@ -21,9 +21,9 @@ #include -#include "wasm.h" -#include "wasm-binary.h" #include "pass.h" +#include "wasm-binary.h" +#include "wasm.h" using namespace std; @@ -31,7 +31,7 @@ namespace wasm { struct Strip : public Pass { // A function that returns true if the method should be removed. - typedef std::function Decider; + typedef std::function Decider; Decider decider; Strip(Decider decider) : decider(decider) {} @@ -39,14 +39,8 @@ struct Strip : public Pass { void run(PassRunner* runner, Module* module) override { // Remove name and debug sections. auto& sections = module->userSections; - sections.erase( - std::remove_if( - sections.begin(), - sections.end(), - decider - ), - sections.end() - ); + sections.erase(std::remove_if(sections.begin(), sections.end(), decider), + sections.end()); // If we're cleaning up debug info, clear on the function and module too. UserSection temp; temp.name = BinaryConsts::UserSections::Name; @@ -60,16 +54,15 @@ struct Strip : public Pass { } }; -Pass *createStripDebugPass() { +Pass* createStripDebugPass() { return new Strip([&](const UserSection& curr) { return curr.name == BinaryConsts::UserSections::Name || curr.name == BinaryConsts::UserSections::SourceMapUrl || - curr.name.find(".debug") == 0 || - curr.name.find("reloc..debug") == 0; + curr.name.find(".debug") == 0 || curr.name.find("reloc..debug") == 0; }); } -Pass *createStripProducersPass() { +Pass* createStripProducersPass() { return new Strip([&](const UserSection& curr) { return curr.name == BinaryConsts::UserSections::Producers; }); -- cgit v1.2.3