From d2550891e41ad0215b1cae46fa711bc1e264166a Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 17 Oct 2019 17:29:32 -0700 Subject: Fix autoreducing when not in the binaryen directory (#2390) This uses argv[0] as the default way to find the location of the wasm binaries (wasm-reduce needs to call wasm-opt). --- src/support/path.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/support/path.h') diff --git a/src/support/path.h b/src/support/path.h index 505ba0d88..e9f675142 100644 --- a/src/support/path.h +++ b/src/support/path.h @@ -28,7 +28,9 @@ namespace wasm { namespace Path { -std::string getPathSeparator(); +char getPathSeparator(); +std::string getDirName(const std::string& path); +std::string getBaseName(const std::string& path); // Get the binaryen root dor. std::string getBinaryenRoot(); @@ -37,10 +39,10 @@ std::string getBinaryenRoot(); std::string getBinaryenBinDir(); // Set the binaryen bin dir (allows tools to change it based on user input). -void setBinaryenBinDir(std::string dir); +void setBinaryenBinDir(const std::string& dir); // Gets the path to a binaryen binary tool, like wasm-opt. -std::string getBinaryenBinaryTool(std::string name); +std::string getBinaryenBinaryTool(const std::string& name); } // namespace Path -- cgit v1.2.3