[PATCH] D17741: adds __FILE_BASENAME__ builtin macro
Weiming Zhao via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 29 17:59:18 PST 2016
weimingz added a comment.
In http://reviews.llvm.org/D17741#364742, @bcraig wrote:
> Note: this doesn't count as an official "LGTM".
>
> The code change seems fine to me. I think this has been implemented in gcc as well, but I don't recall for certain. If this has been implemented in gcc, then I would expect the semantics to be the same. If it hasn't been implemented in gcc, then we might want to pick a different name for the macro (e.g. __CLANG_FILE_BASENAME__).
GCC has a macro "__BASE_FILE__", which I initially thought was for this purpose, but it's not.
__BASE_FILE__
This macro expands to the name of the main input file, in the form of a C string constant. This is the source file that was specified on the command line of the preprocessor or C compiler.
I will rename the macro to CLANG_FILE_BASENAME
http://reviews.llvm.org/D17741
More information about the cfe-commits
mailing list