This is an archive of the discontinued LLVM Phabricator instance.

[Driver] Support priority for multilibs
ClosedPublic

Authored by phosek on Apr 22 2019, 7:32 PM.

Details

Summary

When more than one multilib flag matches, try to select the best
possible match based on priority. When two different multilibs with
the same same priority match, we still throw an error matching the
existing behavior.

Diff Detail

Event Timeline

phosek created this revision.Apr 22 2019, 7:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 22 2019, 7:32 PM

Can this have test coverage?

clang/lib/Driver/Multilib.cpp
22

Doesn't seem to be used?

270

llvm::sort.

phosek updated this revision to Diff 196331.Apr 23 2019, 2:32 PM
phosek marked 2 inline comments as done.
mcgrathr accepted this revision.Apr 24 2019, 4:43 PM
mcgrathr added a subscriber: mcgrathr.

lgtm

clang/include/clang/Driver/Multilib.h
81

Say explicitly that the greatest priority is chosen (sometimes 0 is "best").

This revision is now accepted and ready to land.Apr 24 2019, 4:43 PM
phosek updated this revision to Diff 196905.Apr 26 2019, 12:32 PM
phosek marked an inline comment as done.

Can this have test coverage?

Done, I've added a test.

ormris removed a subscriber: ormris.Apr 26 2019, 12:36 PM
This revision was automatically updated to reflect the committed changes.