Add a platform independent version of __PRETTY_FUNCTION__.

MSVC doesn't have this, it only has __FUNCSIG__.  So this adds
a new macro called LLVM_PRETTY_FUNCTION which evaluates to the
right thing on any platform.

llvm-svn: 278170
This commit is contained in:
Zachary Turner 2016-08-09 22:03:45 +00:00
parent 8ec04577d6
commit e7c2875dc3
1 changed files with 8 additions and 0 deletions

View File

@ -453,6 +453,14 @@ void AnnotateIgnoreWritesEnd(const char *file, int line);
#define LLVM_DUMP_METHOD LLVM_ATTRIBUTE_NOINLINE
#endif
/// \brief Gets a user-friendly looking function signature for the current scope
/// using the best available method on each platform.
#if defined(LLVM_ON_WIN32)
#define LLVM_PRETTY_FUNCTION __FUNCSIG__
#else
#define LLVM_PRETTY_FUNCTION __PRETTY_FUNCTION__
#endif
/// \macro LLVM_THREAD_LOCAL
/// \brief A thread-local storage specifier which can be used with globals,
/// extern globals, and static globals.