Add __builtin_FILE_NAME()
authorIlya Karapsin <ilya84050@gmail.com>
Fri, 17 Mar 2023 13:50:34 +0000 (09:50 -0400)
committerAaron Ballman <aaron@aaronballman.com>
Fri, 17 Mar 2023 13:52:41 +0000 (09:52 -0400)
commit2147e940e8a8f85f97f28407989c628886b5cd7e
treea9bbdc8ced1eee8d22b0c9872c38a241dfafa48d
parent5ecba1543477e5448ec3566aec7b3756f98a3fb6
Add __builtin_FILE_NAME()

Add '__builtin_FILE_NAME()', which expands to the filename because the
full path is not always needed. It corresponds to the '__FILE_NAME__'
predefined macro and is consistent with the other '__builin' functions
added for predefined macros.

Differential Revision: https://reviews.llvm.org/D144878
15 files changed:
clang/docs/LanguageExtensions.rst
clang/docs/ReleaseNotes.rst
clang/include/clang/AST/Expr.h
clang/include/clang/Basic/TokenKinds.def
clang/include/clang/Lex/Preprocessor.h
clang/lib/AST/Expr.cpp
clang/lib/Lex/PPMacroExpansion.cpp
clang/lib/Parse/ParseExpr.cpp
clang/lib/Sema/SemaExpr.cpp
clang/test/Preprocessor/feature_tests.c
clang/test/Preprocessor/feature_tests.cpp
clang/test/Sema/source_location.c
clang/test/SemaCXX/Inputs/source-location-file.h
clang/test/SemaCXX/source_location.cpp
clang/unittests/AST/ASTImporterTest.cpp