This is an archive of the discontinued LLVM Phabricator instance.

[Driver] Search LibraryPaths when handling -print-file-name
ClosedPublic

Authored by phosek on Sep 1 2018, 2:49 PM.

Diff Detail

Repository
rC Clang

Event Timeline

phosek created this revision.Sep 1 2018, 2:49 PM
phosek updated this revision to Diff 163630.Sep 1 2018, 2:51 PM
phosek updated this revision to Diff 163633.Sep 1 2018, 3:02 PM
mcgrathr accepted this revision.Sep 1 2018, 5:16 PM
mcgrathr added a subscriber: mcgrathr.

The log message could give concrete examples.

clang/lib/Driver/Driver.cpp
4169 ↗(On Diff #163633)

A one-line comment before the lambda would help: // Check for Name in Path. (rename the param to be clearer)

4173 ↗(On Diff #163633)

I'd always use const auto& in a range-for like this, but I guess this was just moved around and maybe LLVM style frowns on auto?

4179 ↗(On Diff #163633)

Can this be return {P.str()};?

4184 ↗(On Diff #163633)

I'd always use auto in these situations (here and below).

4187 ↗(On Diff #163633)

You could fold these cases into the lambda too by having it take a bool UseSysRoot and passing {ResourceDir}, false.
Then the main body is a uniform and concise list of paths to check.

This revision is now accepted and ready to land.Sep 1 2018, 5:16 PM
phosek updated this revision to Diff 163636.Sep 1 2018, 9:52 PM
phosek marked 4 inline comments as done.
phosek added inline comments.Sep 3 2018, 2:19 PM
clang/lib/Driver/Driver.cpp
4187 ↗(On Diff #163633)

I considered that but llvm::SmallVector doesn't support initializer list so this ends up looking not so great.

This revision was automatically updated to reflect the committed changes.