Revert "[WindowsDriver] Improve VSInstallPath check for IDE subdirectory"
authorDimitry Andric <dimitry@andric.com>
Thu, 15 Dec 2022 20:36:32 +0000 (21:36 +0100)
committerDimitry Andric <dimitry@andric.com>
Thu, 15 Dec 2022 20:36:32 +0000 (21:36 +0100)
This reverts commit cc40dacbd0b736522d0254fb5525cde22bd5f166.

llvm/lib/WindowsDriver/MSVCPaths.cpp

index d7703e9..fb89919 100644 (file)
@@ -705,10 +705,8 @@ bool findVCToolChainViaRegistry(std::string &Path, ToolsetLayout &VSLayout) {
       getSystemRegistryString(R"(SOFTWARE\Microsoft\VCExpress\$VERSION)",
                               "InstallDir", VSInstallPath, nullptr)) {
     if (!VSInstallPath.empty()) {
-      auto pos = VSInstallPath.find(R"(\Common7\IDE)");
-      if(pos == std::string::npos)
-        return false;
-      SmallString<256> VCPath(StringRef(VSInstallPath.c_str(), pos));
+      SmallString<256> VCPath(StringRef(VSInstallPath.c_str(),
+                                        VSInstallPath.find(R"(\Common7\IDE)")));
       sys::path::append(VCPath, "VC");
 
       Path = std::string(VCPath.str());