[PATCH] D135724: [HIP] Fix unbundling archive

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 12 10:43:13 PDT 2022


yaxunl added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/CommonArgs.cpp:1839
   auto Ext = IsMSVC ? ".lib" : ".a";
-  if (!Lib.startswith(":") && llvm::sys::fs::exists(Lib)) {
-    ArchiveOfBundles = Lib;
-    FoundAOB = true;
+  if (!Lib.startswith(":") && !Lib.startswith("-l")) {
+    if (llvm::sys::fs::exists(Lib)) {
----------------
tra wrote:
> I'm puzzled a bit. What is expected to be in 'Lib' ?
> If it contains the the whole `-llibrary` option passed by the user, then why do we check for `:` prefix?
> If it contains whatever was passed via `-l<something>`, but without `-l` itself, then why do we check for  `-l` prefix?
> 
This function is also used for unbundling archive files specified as input files in the clang command line. There are three cases:

For option `-l:xxx`, Lib contains `:xxx`.

For option `-lxxx`, Lib contains `-lxxx`.

For `xxx.a` passed as input file, Lib contains `xxx.a`.


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

https://reviews.llvm.org/D135724



More information about the cfe-commits mailing list