[PATCH] D85998: Add clang-cl "vctoolsdir" option to specify the location of the msvc toolchain

Alexandre Ganea via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 24 10:52:22 PDT 2020


aganea added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/MSVC.cpp:73
+                              MSVCToolChain::ToolsetLayout &VSLayout) {
+  // Don't validate the input; trust the value supplied by the user.
+  // The primary motivation is to prevent unnecessary file and registry access.
----------------
hans wrote:
> What will the error look like if the user sets this but gets it wrong? I'm sympathetic to not wanting to validate it, but if it's wrong it would be nice if the error isn't too cryptic.
@hans The flag proposed here behaves like `env VCToolsInstallDir="" clang-cl ...`, and in that case there's no validation. Do you think the path to `-vctoolsdir` should be validated and throw an error otherwise? I find it nice to completly disable the toolchain auto-detection if passing in a empty dir, without needing an additional flag, ie `clang-cl -vctoolsdir ""`.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85998/new/

https://reviews.llvm.org/D85998



More information about the cfe-commits mailing list