[PATCH] D61756: Add a __FILE_NAME__ macro.

Kristina Brooks via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 10 15:55:49 PDT 2019


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.

After running it with a hack to dump the paths to stderr they seem to be the same regardless.

  [FILENAME] /llvm-tainted/tools/clang/test/Preprocessor/Inputs/include-subdir/subdir1/hdr1.h
  [FILENAME] /llvm-tainted/tools/clang/test/Preprocessor/Inputs/include-subdir/subdir1/hdr2.h

I've also extended the tests to cover scenarios with mixed slashes in MS compatibility mode and removed the unnecessary check.


Repository:
  rC Clang

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

https://reviews.llvm.org/D61756

Files:
  include/clang/Lex/Preprocessor.h
  lib/Lex/PPMacroExpansion.cpp
  test/Preprocessor/Inputs/include-subdir/file_name_macro_include.h
  test/Preprocessor/Inputs/include-subdir/h
  test/Preprocessor/Inputs/include-subdir/subdir1/hdr1.h
  test/Preprocessor/Inputs/include-subdir/subdir1/hdr2.h
  test/Preprocessor/file_name_macro.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61756.199104.patch
Type: text/x-patch
Size: 5299 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190510/f5142139/attachment.bin>


More information about the cfe-commits mailing list