Go to the documentation of this file. 15 #ifndef LLVM_DEMANGLE_COMPILER_H 16 #define LLVM_DEMANGLE_COMPILER_H 19 #define __has_feature(x) 0 22 #ifndef __has_cpp_attribute 23 #define __has_cpp_attribute(x) 0 26 #ifndef __has_attribute 27 #define __has_attribute(x) 0 31 #define __has_builtin(x) 0 34 #ifndef DEMANGLE_GNUC_PREREQ 35 #if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) 36 #define DEMANGLE_GNUC_PREREQ(maj, min, patch) \ 37 ((__GNUC__ << 20) + (__GNUC_MINOR__ << 10) + __GNUC_PATCHLEVEL__ >= \ 38 ((maj) << 20) + ((min) << 10) + (patch)) 39 #elif defined(__GNUC__) && defined(__GNUC_MINOR__) 40 #define DEMANGLE_GNUC_PREREQ(maj, min, patch) \ 41 ((__GNUC__ << 20) + (__GNUC_MINOR__ << 10) >= ((maj) << 20) + ((min) << 10)) 43 #define DEMANGLE_GNUC_PREREQ(maj, min, patch) 0 47 #if __has_attribute(used) || DEMANGLE_GNUC_PREREQ(3, 1, 0) 48 #define DEMANGLE_ATTRIBUTE_USED __attribute__((__used__)) 50 #define DEMANGLE_ATTRIBUTE_USED 53 #if __has_builtin(__builtin_unreachable) || DEMANGLE_GNUC_PREREQ(4, 5, 0) 54 #define DEMANGLE_UNREACHABLE __builtin_unreachable() 55 #elif defined(_MSC_VER) 56 #define DEMANGLE_UNREACHABLE __assume(false) 58 #define DEMANGLE_UNREACHABLE 61 #if __has_attribute(noinline) || DEMANGLE_GNUC_PREREQ(3, 4, 0) 62 #define DEMANGLE_ATTRIBUTE_NOINLINE __attribute__((noinline)) 63 #elif defined(_MSC_VER) 64 #define DEMANGLE_ATTRIBUTE_NOINLINE __declspec(noinline) 66 #define DEMANGLE_ATTRIBUTE_NOINLINE 70 #define DEMANGLE_DUMP_METHOD DEMANGLE_ATTRIBUTE_NOINLINE DEMANGLE_ATTRIBUTE_USED 72 #define DEMANGLE_DUMP_METHOD DEMANGLE_ATTRIBUTE_NOINLINE 75 #if __cplusplus > 201402L && __has_cpp_attribute(fallthrough) 76 #define DEMANGLE_FALLTHROUGH [[fallthrough]] 77 #elif __has_cpp_attribute(gnu::fallthrough) 78 #define DEMANGLE_FALLTHROUGH [[gnu::fallthrough]] 82 #define DEMANGLE_FALLTHROUGH 83 #elif __has_cpp_attribute(clang::fallthrough) 84 #define DEMANGLE_FALLTHROUGH [[clang::fallthrough]] 86 #define DEMANGLE_FALLTHROUGH 89 #define DEMANGLE_NAMESPACE_BEGIN namespace llvm { namespace itanium_demangle { 90 #define DEMANGLE_NAMESPACE_END } }