hans created this revision. The code wasn't taking the architecture-specific subdirectory into account.
https://reviews.llvm.org/D33258 Files: lib/Driver/ToolChains/MSVC.cpp Index: lib/Driver/ToolChains/MSVC.cpp =================================================================== --- lib/Driver/ToolChains/MSVC.cpp +++ lib/Driver/ToolChains/MSVC.cpp @@ -124,9 +124,19 @@ if (!llvm::sys::fs::exists(ExeTestPath)) continue; - // whatever/VC/bin --> old toolchain, VC dir is toolchain dir. - if (llvm::sys::path::filename(PathEntry) == "bin") { - llvm::StringRef ParentPath = llvm::sys::path::parent_path(PathEntry); + // Strip any architecture specific subdirectory. + llvm::StringRef TestPath = PathEntry; + if (llvm::sys::path::filename(TestPath) == "amd64" || + llvm::sys::path::filename(TestPath) == "amd64_arm" || + llvm::sys::path::filename(TestPath) == "amd64_x86" || + llvm::sys::path::filename(TestPath) == "arm" || + llvm::sys::path::filename(TestPath) == "x86_amd64" || + llvm::sys::path::filename(TestPath) == "x86_arm") + TestPath = llvm::sys::path::parent_path(TestPath); + + // whatever/VC/bin --> old toolchain, // VC dir is toolchain dir. + if (llvm::sys::path::filename(TestPath) == "bin") { + llvm::StringRef ParentPath = llvm::sys::path::parent_path(TestPath); if (llvm::sys::path::filename(ParentPath) == "VC") { Path = ParentPath; IsVS2017OrNewer = false;
Index: lib/Driver/ToolChains/MSVC.cpp =================================================================== --- lib/Driver/ToolChains/MSVC.cpp +++ lib/Driver/ToolChains/MSVC.cpp @@ -124,9 +124,19 @@ if (!llvm::sys::fs::exists(ExeTestPath)) continue; - // whatever/VC/bin --> old toolchain, VC dir is toolchain dir. - if (llvm::sys::path::filename(PathEntry) == "bin") { - llvm::StringRef ParentPath = llvm::sys::path::parent_path(PathEntry); + // Strip any architecture specific subdirectory. + llvm::StringRef TestPath = PathEntry; + if (llvm::sys::path::filename(TestPath) == "amd64" || + llvm::sys::path::filename(TestPath) == "amd64_arm" || + llvm::sys::path::filename(TestPath) == "amd64_x86" || + llvm::sys::path::filename(TestPath) == "arm" || + llvm::sys::path::filename(TestPath) == "x86_amd64" || + llvm::sys::path::filename(TestPath) == "x86_arm") + TestPath = llvm::sys::path::parent_path(TestPath); + + // whatever/VC/bin --> old toolchain, // VC dir is toolchain dir. + if (llvm::sys::path::filename(TestPath) == "bin") { + llvm::StringRef ParentPath = llvm::sys::path::parent_path(TestPath); if (llvm::sys::path::filename(ParentPath) == "VC") { Path = ParentPath; IsVS2017OrNewer = false;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits