[PATCH] D51338: [llvm-ar] Support * as comment char in MIR scripts

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 29 13:11:56 PDT 2018


mstorsjo added inline comments.


================
Comment at: tools/llvm-ar/llvm-ar.cpp:815
       Rest = Rest.drop_front().drop_back();
+    if (CommandStr.startswith(";") || CommandStr.startswith("*"))
+      continue;
----------------
pcc wrote:
> mstorsjo wrote:
> > pcc wrote:
> > > What should happen if a line contains both a command and a comment?
> > I'm not sure I'm following, can you elaborate?
> > 
> > If the first word of the line starts with either `;` or `*`, the whole line is a comment.
> I mean what should be the interpretation of the line `addlib foo.a ; comment`? Does it add a library named `foo.a` or `foo.a ; comment` or is it an error?
Oh, good point. When checking with GNU 'ar', it creates a library named `foo.a` only.

I'll see if I can amend the code to handle this as well.


Repository:
  rL LLVM

https://reviews.llvm.org/D51338





More information about the llvm-commits mailing list