This is an archive of the discontinued LLVM Phabricator instance.

Make clang-cl accept .lib inputs
ClosedPublic

Authored by ehsan on Jun 18 2014, 5:13 AM.

Details

Summary

This enables passing in the names of libraries found in the system LIB paths to cl.exe, and verifies that such libraries are passed to the linker.

Diff Detail

Event Timeline

ehsan updated this revision to Diff 10552.Jun 18 2014, 5:13 AM
ehsan retitled this revision from to Make clang-cl accept .lib inputs.
ehsan updated this object.
ehsan edited the test plan for this revision. (Show Details)
ehsan added a reviewer: hans.
hans edited edge metadata.Jun 18 2014, 10:04 AM

Thanks for the patch! Just some cosmetic comments:

lib/Driver/Driver.cpp
934

I would have gone for a name such as "ExistsInLibDir".

935

This is copied from FindFallback in Tools.cpp. Maybe we should think about a way to factor this out into some utility in llvm::sys.. no need to block this patch on that, though.

I think some of the names could be improved, though. PathSegments below could be better named as LibDirs, for example.

948

Maybe use a range-based for loop?

984

Since this is a clang-cl specific thing, we should guard this check with "D.IsCLMode()".

ehsan updated this revision to Diff 10573.Jun 18 2014, 10:15 AM
ehsan edited edge metadata.

Addressed the review comments. I'll work on refactoring this utility function later.

hans accepted this revision.Jun 18 2014, 10:29 AM
hans edited edge metadata.

lgtm

This revision is now accepted and ready to land.Jun 18 2014, 10:29 AM
hans closed this revision.Jun 18 2014, 10:30 AM
hans updated this revision to Diff 10576.

Closed by commit rL211189 (authored by @hans).