forked from OSchip/llvm-project
d614874900
This builtin returns the address of a global instance of the `std::source_location::__impl` type, which must be defined (with an appropriate shape) before calling the builtin. It will be used to implement std::source_location in libc++ in a future change. The builtin is compatible with GCC's implementation, and libstdc++'s usage. An intentional divergence is that GCC declares the builtin's return type to be `const void*` (for ease-of-implementation reasons), while Clang uses the actual type, `const std::source_location::__impl*`. In order to support this new functionality, I've also added a new 'UnnamedGlobalConstantDecl'. This artificial Decl is modeled after MSGuidDecl, and is used to represent a generic concept of an lvalue constant with global scope, deduplicated by its value. It's possible that MSGuidDecl itself, or some of the other similar sorts of things in Clang might be able to be refactored onto this more-generic concept, but there's enough special-case weirdness in MSGuidDecl that I gave up attempting to share code there, at least for now. Finally, for compatibility with libstdc++'s <source_location> header, I've added a second exception to the "cannot cast from void* to T* in constant evaluation" rule. This seems a bit distasteful, but feels like the best available option. Reviewers: aaron.ballman, erichkeane Differential Revision: https://reviews.llvm.org/D120159 |
||
---|---|---|
.. | ||
ARCMigrate.cpp | ||
BuildSystem.cpp | ||
CIndex.cpp | ||
CIndexCXX.cpp | ||
CIndexCodeCompletion.cpp | ||
CIndexDiagnostic.cpp | ||
CIndexDiagnostic.h | ||
CIndexHigh.cpp | ||
CIndexInclusionStack.cpp | ||
CIndexUSRs.cpp | ||
CIndexer.cpp | ||
CIndexer.h | ||
CLog.h | ||
CMakeLists.txt | ||
CXComment.cpp | ||
CXComment.h | ||
CXCompilationDatabase.cpp | ||
CXCursor.cpp | ||
CXCursor.h | ||
CXIndexDataConsumer.cpp | ||
CXIndexDataConsumer.h | ||
CXLoadedDiagnostic.cpp | ||
CXLoadedDiagnostic.h | ||
CXSourceLocation.cpp | ||
CXSourceLocation.h | ||
CXStoredDiagnostic.cpp | ||
CXString.cpp | ||
CXString.h | ||
CXTranslationUnit.h | ||
CXType.cpp | ||
CXType.h | ||
CursorVisitor.h | ||
FatalErrorHandler.cpp | ||
Index_Internal.h | ||
Indexing.cpp | ||
Rewrite.cpp | ||
libclang.map | ||
linker-script-to-export-list.py |