[WebAssembly] Find wasm-opt with GetProgramPath
authorDan Gohman <sunfish@mozilla.com>
Mon, 2 Dec 2019 19:47:31 +0000 (11:47 -0800)
committerDan Gohman <sunfish@mozilla.com>
Mon, 2 Dec 2019 19:48:36 +0000 (11:48 -0800)
commit8f1e2151b8e923345a18aa3025a7d074e134768b
treed7edb2ede46f0c260e2c37805f3b316c45cbc65e
parent1d4587346f51ca5cc5741337cadfaeb208ca59ad
[WebAssembly] Find wasm-opt with GetProgramPath

Instead of just searching for wasm-opt in PATH, use GetProgramPath, which
checks the `COMPILER_PATH` environment variable, -B paths, and `PATH`.

Differential Revision: https://reviews.llvm.org/D70780
clang/lib/Driver/ToolChains/WebAssembly.cpp