HomePhabricator

Reland "[Clang][PP] Add the __FILE_NAME__ builtin macro"

Description

Reland "[Clang][PP] Add the FILE_NAME builtin macro"

This relands commit rL360833 which caused issues on Win32
bots due to path handling/normalization differences. Now
this uses sys::path::filename which should handle
additional edge cases on Win32.

Original commit:

"[Clang][PP] Add the FILE_NAME builtin macro"

This patch adds the FILE_NAME macro that expands to the
last component of the path, similar to FILE except with
a guarantee that only the last path component (without the
separator) will be rendered.

I intend to follow through with discussion of this with WG14
as a potential inclusion in the C standard or failing that,
try to discuss this with GCC developers since this extension
is desired by GCC and Clang users/developers alike.

Differential Revision: https://reviews.llvm.org/D61756

Details

Committed
kristinaMay 16 2019, 2:13 PM
Differential Revision
D61756: Add a __FILE_NAME__ macro.
Parents
rC360937: Implement __builtin_LINE() et. al. to support source location capture.
Branches
Unknown
Tags
Unknown