This is an archive of the discontinued LLVM Phabricator instance.

Use the newly added FindInEnvPath helper in clang
ClosedPublic

Authored by ehsan on Jun 18 2014, 5:17 PM.

Details

Reviewers
hans

Diff Detail

Event Timeline

ehsan updated this revision to Diff 10598.Jun 18 2014, 5:17 PM
ehsan retitled this revision from to Use the newly added FindInEnvPath helper in clang.
ehsan updated this object.
ehsan edited the test plan for this revision. (Show Details)
ehsan added a reviewer: hans.
ehsan added a subscriber: Unknown Object (MLST).
hans added inline comments.Jun 19 2014, 9:47 AM
lib/Driver/Driver.cpp
933

I think Optional<> provides a bool conversion operator, so you can just do: "return llvm::sys::FindInEnvPath("LIB", Value);".. and since the function is now just one line, maybe inline it into the caller.

lib/Driver/Tools.cpp
7556

This doesn't work. The previous code handles the case where there are multiple cl.exe on the PATH, whereas the new code just returns the first one.

This function is used in the Visual Studio clang-cl integration, where we rename clang-cl.exe to cl.exe and put it first on PATH. This function is then used to find the real cl.exe.

I think we have to leave this code as it is (though we can remove the definition of PathSeparators and use llvm::sys::EnvPathSeparator).

Good points. I'll submit a new patch once we decide where to put the function itself.

ehsan updated this revision to Diff 10650.Jun 19 2014, 11:35 AM

Addressed the review comment.

hans accepted this revision.Jun 19 2014, 12:42 PM
hans edited edge metadata.

lgtm

This revision is now accepted and ready to land.Jun 19 2014, 12:42 PM
ehsan closed this revision.Jun 30 2014, 1:05 PM

Landed in r212058.