[PATCH] D57930: [Driver] Verify GCCInstallation is valid

Daniel Mentz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 11 16:30:06 PST 2019


danielmentz marked an inline comment as done.
danielmentz added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/Linux.cpp:259-260
 
   if (GCCInstallation.getParentLibPath().find("opt/rh/devtoolset") !=
       StringRef::npos)
     // With devtoolset on RHEL, we want to add a bin directory that is relative
----------------
tstellar wrote:
> Do we need to add the same check here too?
I'd say no, we don't need it here. If GCCInstallation is not valid, then GCCInstallation.getParentLibPath() will probably return the empty string, and .find("opt/rh/devtoolset") on that empty string will probably return StringRef::npos, in which case the if body is not run.
I understand the concern, but I think, in this case, we got lucky.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D57930





More information about the cfe-commits mailing list