[PATCH] D61756: Add a __FILE_NAME__ macro.

2020-04-25 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. In D61756#2003847 , @kristina wrote: > In D61756#2003836 , @MaskRay wrote: > > > > @rmisth wrote: "Clang should drive the standard, not diverge from it", > > > and we should at least try to

[PATCH] D61756: Add a __FILE_NAME__ macro.

2020-04-25 Thread Kristina Brooks via Phabricator via cfe-commits
kristina added a comment. In 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 __

[PATCH] D61756: Add a __FILE_NAME__ macro.

2020-04-25 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. > @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 , @kristina wro

[PATCH] D61756: Add a __FILE_NAME__ macro.

2019-05-16 Thread Kristina Brooks via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC360938: Reland "[Clang][PP] Add the __FILE_NAME__ builtin macro" (authored by kristina, committed by ). Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61756/new/ https://re

[PATCH] D61756: Add a __FILE_NAME__ macro.

2019-05-16 Thread Kristina Brooks via Phabricator via cfe-commits
kristina updated this revision to Diff 199882. kristina edited the summary of this revision. kristina added a comment. Revised to use `llvm::sys::path::filename` to avoid issues on Windows hosts. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61756/new/ https://re

[PATCH] D61756: Add a __FILE_NAME__ macro.

2019-05-16 Thread Don Hinton via Phabricator via cfe-commits
hintonda added a comment. In D61756#1504109 , @kristina wrote: > Reverted in rL360842 as Windows bots were > failing. > > I suspect the `MSVCCompat` case may need to be handled differently depending > on the host OS si

[PATCH] D61756: Add a __FILE_NAME__ macro.

2019-05-15 Thread Kristina Brooks via Phabricator via cfe-commits
kristina reopened this revision. kristina added a comment. This revision is now accepted and ready to land. Reverted in rL360842 as Windows bots were failing. I suspect the `MSVCCompat` case may need to be handled differently depending on the host OS similar

[PATCH] D61756: Add a __FILE_NAME__ macro.

2019-05-15 Thread Kristina Brooks via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC360833: [Clang][PP] Add the __FILE_NAME__ builtin macro. (authored by kristina, committed by ). Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61756/new/ https://reviews.ll

[PATCH] D61756: Add a __FILE_NAME__ macro.

2019-05-15 Thread Kristina Brooks via Phabricator via cfe-commits
kristina added a comment. Landing this as discussed on IRC, will try to push it forward with WG14. I think having something like this as part of the standard would benefit a lot, since currently the "unofficial" way of doing this for either GCC or Clang involves several nonstandard builtins and

[PATCH] D61756: Add a __FILE_NAME__ macro.

2019-05-15 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a subscriber: alexr. rsmith added a comment. Generally, I think this is a good, useful feature, but there's one point from http://clang.llvm.org/get_involved.html 's checklist for accepting language extensions on which its case is weak, as reflected by this feedback from @alexr on

[PATCH] D61756: Add a __FILE_NAME__ macro.

2019-05-15 Thread Kristina Brooks via Phabricator via cfe-commits
kristina added a comment. @rsmith Ping. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61756/new/ https://reviews.llvm.org/D61756 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[PATCH] D61756: Add a __FILE_NAME__ macro.

2019-05-10 Thread Kristina Brooks via Phabricator via cfe-commits
kristina added a comment. Need @rsmith to bless this as it's introducing a nonstandard extension, however small it may be. The original diff did have a consensus on it, so I didn't really put up a formal RFC on `cfe-dev`. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm

[PATCH] D61756: Add a __FILE_NAME__ macro.

2019-05-10 Thread Kristina Brooks via Phabricator via cfe-commits
kristina updated this revision to Diff 199104. kristina edited the summary of this revision. kristina added a comment. Actually I got it wrong, the path is normalized to use regular slashes at that point, so there is no point in handling backslashes in paths at all even with Microsoft extensions

[PATCH] D61756: Add a __FILE_NAME__ macro.

2019-05-09 Thread Shawn Landden via Phabricator via cfe-commits
shawnl requested changes to this revision. shawnl added a comment. This revision now requires changes to proceed. There is no documentation specific to the #include directive. https://docs.microsoft.com/en-us/cpp/preprocessor/hash-include-directive-c-cpp?view=vs-2019 However, fileio treats / and

[PATCH] D61756: Add a __FILE_NAME__ macro.

2019-05-09 Thread Shawn Landden via Phabricator via cfe-commits
shawnl added inline comments. Comment at: lib/Lex/PPMacroExpansion.cpp:1509 +if (LastSep == StringRef::npos && LangOpts.MicrosoftExt) + LastSep = PLFileName.find_last_of('\\'); + What is the path name uses both \ and / to separate paths?

[PATCH] D61756: Add a __FILE_NAME__ macro.

2019-05-09 Thread Kristina Brooks via Phabricator via cfe-commits
kristina updated this revision to Diff 198894. kristina added a comment. Fix style, remove unnecessary braces, add missing newline. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61756/new/ https://reviews.llvm.org/D61756 Files: include/clang/Lex/Preprocessor.h

[PATCH] D61756: Add a __FILE_NAME__ macro.

2019-05-09 Thread Kristina Brooks via Phabricator via cfe-commits
kristina created this revision. kristina added reviewers: aaron.ballman, rsmith, rnk. Herald added a project: clang. A much simplified version of D17741 which adds a new builtin macro `__FILE_NAME__` that is similar to `__FILE__` but only renders the last path c