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(
          llvm::sys::path::parent_path(GPPName.get()));
  else
    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.


http://reviews.llvm.org/D15006



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to