diff options
author | Dmitri Gribenko <gribozavr@gmail.com> | 2013-01-11 01:13:51 +0000 |
---|---|---|
committer | Dmitri Gribenko <gribozavr@gmail.com> | 2013-01-11 01:13:51 +0000 |
commit | caa91f8b8562a18eb9b66916660f950be027fd9f (patch) | |
tree | 9ba7cfda1889cf106745f1afbe769734b3beb6e1 /include | |
parent | cbdb7e4b560f77f49f042ea47eac6d4980d8bece (diff) | |
download | external_llvm-caa91f8b8562a18eb9b66916660f950be027fd9f.zip external_llvm-caa91f8b8562a18eb9b66916660f950be027fd9f.tar.gz external_llvm-caa91f8b8562a18eb9b66916660f950be027fd9f.tar.bz2 |
Add a new portability macro LLVM_FUNCTION_NAME, that expands to __func__, if
supported.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172156 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Support/Compiler.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/Support/Compiler.h b/include/llvm/Support/Compiler.h index b32939e..e639a2c 100644 --- a/include/llvm/Support/Compiler.h +++ b/include/llvm/Support/Compiler.h @@ -249,4 +249,13 @@ # define LLVM_ASSUME_ALIGNED(p, a) (p) #endif +/// \macro LLVM_FUNCTION_NAME +/// \brief Expands to __func__ on compilers which support it. Otherwise, +/// expands to a compiler-dependent replacement. +#if defined(_MSC_VER) +# define LLVM_FUNCTION_NAME __FUNCTION__ +#else +# define LLVM_FUNCTION_NAME __func__ +#endif + #endif |