[PATCH] D15006: Driver: Better detection of mingw-gcc

Yaron Keren via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 26 09:15:47 PST 2015

yaron.keren added a comment.

findGccDir() can return llvm::ErrorOr<std::string> and then all Base assignments happen at the same if-elseif-else:

  if (getDriver().SysRoot.size())
    Base = getDriver().SysRoot;
  else if (llvm::ErrorOr<std::string> GPPName = findGccDir())
   Base = llvm::sys::path::parent_path(
    Base = llvm::sys::path::parent_path(getDriver().getInstalledDir());

Then, findGccDir() is actually findGcc().

About tests, adding empty script "gcc" with x set in the directory structure, and adding the directory to the path at start of the LIT test may work. It will fail on Windows so try this with a new test file so we can XFAIL:windows only the new one if required.


More information about the cfe-commits mailing list