[PATCH] D61756: Add a __FILE_NAME__ macro.

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 25 15:24:02 PDT 2020


MaskRay added a comment.

In D61756#2003847 <https://reviews.llvm.org/D61756#2003847>, @kristina wrote:

> In D61756#2003836 <https://reviews.llvm.org/D61756#2003836>, @MaskRay wrote:
>
> > > @rmisth wrote: "Clang should drive the standard, not diverge from it", and we should at least try to push for standardizing this if we think it's worthwhile as an alternative to __FILE__.
> >
> >
> >
> > In D61756#1505296 <https://reviews.llvm.org/D61756#1505296>, @kristina wrote:
> >
> > > Revised to use `llvm::sys::path::filename` to avoid issues on Windows hosts.
> >
> >
> > Hi @kristina, have you followed up with the extension on WG14 or WG21 mailing lists? There is a similar GCC feature request which you may want to comment as well https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77488
>
>
> I did try bringing this up with GCC developers at one point but the overwhelming consensus was that there wasn't a need for such an extension as 'it's possible to just `#define FILENAME "foo.c"`', with regards to WG14, I was told it was best to get it adopted by other compiler vendors first (ie. GCC). Been pretty sick recently so haven't had time to chase up a lot of loose ends up, should probably get back to that, but it seems WG21 may be the best bet at this point. I'll try to get back on top of everything soon, sorry. Have a pretty big backlog of other things that have also accumulated too.


Thanks for your prompt reply. Hope you will get better soon. I was searching for some unrelated things on GCC's issue tracker when I happened to find `Proposal for __FILENAME_ONLY__` which reminded me of this issue. Glad that you've brought up this to them. I just want the compiler extensions to be compatible if they are going to implement the similar thing.


Repository:
  rC Clang

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

https://reviews.llvm.org/D61756





More information about the llvm-commits mailing list