[PATCH] D42758: Support `#pragma comment(lib, "name")` in the frontend for ELF
Rui Ueyama via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 1 13:22:48 PST 2018
On Wed, Jan 31, 2018 at 7:23 PM, Paul Robinson via Phabricator <
reviews at reviews.llvm.org> wrote:
> probinson added a comment.
>
> In https://reviews.llvm.org/D42758#993936, @ruiu wrote:
>
> > > I also wonder which is better `#pragma comment(lib, "m")` or `#pragma
> comment(lib, "m")`.
> >
> > Sorry, I meant `#pragma comment(lib, "m")` or `#pragma comment("lib",
> "m")`.
>
>
> I can't swear to it but I don't think Microsoft invented `#pragma
> comment`. Various IBM compilers have it, with a syntax of `#pragma comment
> ( <keyword> [ , "string" ] )`. I'm not seeing a `lib` keyword specifically
> in the IBM docs, but being a keyword would be consistent with past practice.
>
Thank you for the info. If it's a common practice, I don't see a reason to
change that.
>
> ================
> Comment at: lib/Parse/ParsePragma.cpp:299
> + getTargetInfo().getTriple().isOSBinFormatELF()) {
> MSCommentHandler.reset(new PragmaCommentHandler(Actions));
> PP.AddPragmaHandler(MSCommentHandler.get());
> ----------------
> PS4's binary format is ELF, so you should be able to remove the isPS4
> predicate.
>
>
> ================
> Comment at: lib/Parse/ParsePragma.cpp:382
> + getTargetInfo().getTriple().isOSBinFormatELF()) {
> PP.RemovePragmaHandler(MSCommentHandler.get());
> MSCommentHandler.reset();
> ----------------
> Don't need isPS4, as it uses ELF.
>
>
> Repository:
> rC Clang
>
> https://reviews.llvm.org/D42758
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180201/970a864b/attachment.html>
More information about the cfe-commits
mailing list