[PATCH] D61756: Add a __FILE_NAME__ macro.

Kristina Brooks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 15 17:42:08 PDT 2019


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 `__FILE__` which causes difficulties in reproducible builds as code emitted in read only data sections may still differ depending on optimization levels and other factors. This macro on the other hand provides a guarantee that only the last path component is rendered.


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