Go to the documentation of this file.
15#ifndef LLVM_DEMANGLE_DEMANGLECONFIG_H
16#define LLVM_DEMANGLE_DEMANGLECONFIG_H
19#include "llvm/Config/llvm-config.h"
22#define __has_feature(x) 0
25#ifndef __has_cpp_attribute
26#define __has_cpp_attribute(x) 0
29#ifndef __has_attribute
30#define __has_attribute(x) 0
34#define __has_builtin(x) 0
37#ifndef DEMANGLE_GNUC_PREREQ
38#if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
39#define DEMANGLE_GNUC_PREREQ(maj, min, patch) \
40 ((__GNUC__ << 20) + (__GNUC_MINOR__ << 10) + __GNUC_PATCHLEVEL__ >= \
41 ((maj) << 20) + ((min) << 10) + (patch))
42#elif defined(__GNUC__) && defined(__GNUC_MINOR__)
43#define DEMANGLE_GNUC_PREREQ(maj, min, patch) \
44 ((__GNUC__ << 20) + (__GNUC_MINOR__ << 10) >= ((maj) << 20) + ((min) << 10))
46#define DEMANGLE_GNUC_PREREQ(maj, min, patch) 0
50#if __has_attribute(used) || DEMANGLE_GNUC_PREREQ(3, 1, 0)
51#define DEMANGLE_ATTRIBUTE_USED __attribute__((__used__))
53#define DEMANGLE_ATTRIBUTE_USED
56#if __has_builtin(__builtin_unreachable) || DEMANGLE_GNUC_PREREQ(4, 5, 0)
57#define DEMANGLE_UNREACHABLE __builtin_unreachable()
58#elif defined(_MSC_VER)
59#define DEMANGLE_UNREACHABLE __assume(false)
61#define DEMANGLE_UNREACHABLE
64#if __has_attribute(noinline) || DEMANGLE_GNUC_PREREQ(3, 4, 0)
65#define DEMANGLE_ATTRIBUTE_NOINLINE __attribute__((noinline))
66#elif defined(_MSC_VER)
67#define DEMANGLE_ATTRIBUTE_NOINLINE __declspec(noinline)
69#define DEMANGLE_ATTRIBUTE_NOINLINE
73#define DEMANGLE_DUMP_METHOD DEMANGLE_ATTRIBUTE_NOINLINE DEMANGLE_ATTRIBUTE_USED
75#define DEMANGLE_DUMP_METHOD DEMANGLE_ATTRIBUTE_NOINLINE
78#if __cplusplus > 201402L && __has_cpp_attribute(fallthrough)
79#define DEMANGLE_FALLTHROUGH [[fallthrough]]
80#elif __has_cpp_attribute(gnu::fallthrough)
81#define DEMANGLE_FALLTHROUGH [[gnu::fallthrough]]
85#define DEMANGLE_FALLTHROUGH
86#elif __has_cpp_attribute(clang::fallthrough)
87#define DEMANGLE_FALLTHROUGH [[clang::fallthrough]]
89#define DEMANGLE_FALLTHROUGH
92#ifndef DEMANGLE_ASSERT
94#define DEMANGLE_ASSERT(__expr, __msg) assert((__expr) && (__msg))
97#define DEMANGLE_NAMESPACE_BEGIN namespace llvm { namespace itanium_demangle {
98#define DEMANGLE_NAMESPACE_END } }
102#if defined(LLVM_BUILD_STATIC) || !defined(LLVM_ENABLE_LLVM_EXPORT_ANNOTATIONS)
106#if defined(LLVM_EXPORTS)
107#define DEMANGLE_ABI __declspec(dllexport)
109#define DEMANGLE_ABI __declspec(dllimport)
112#if __has_attribute(visibility)
113#define DEMANGLE_ABI __attribute__((__visibility__("default")))