[Demangle] Guard DEMANGLE_ABI and add missing annotation (#202920)
This updates the DEMANGLE_ABI annotation to only be defined if it is not already defined. This is required to parse the Demangle headers with the ids-check script. In addition, this adds one missing DEMANGLE_ABI annotation. This effort is tracked in #109483.
This commit is contained in:
parent
b836063bbf
commit
8210a58044
3 changed files with 24 additions and 19 deletions
|
|
@ -31,7 +31,7 @@ class Node;
|
|||
|
||||
// Stream that AST nodes write their string representation into after the AST
|
||||
// has been parsed.
|
||||
class OutputBuffer {
|
||||
class DEMANGLE_ABI OutputBuffer {
|
||||
char *Buffer = nullptr;
|
||||
size_t CurrentPosition = 0;
|
||||
size_t BufferCapacity = 0;
|
||||
|
|
|
|||
|
|
@ -97,24 +97,29 @@
|
|||
#define DEMANGLE_NAMESPACE_BEGIN namespace llvm { namespace itanium_demangle {
|
||||
#define DEMANGLE_NAMESPACE_END } }
|
||||
|
||||
/// DEMANGLE_ABI is the export/visibility macro used to mark symbols delcared in
|
||||
/// DEMANGLE_ABI is the export/visibility macro used to mark symbols declared in
|
||||
/// llvm/Demangle as exported when built as a shared library.
|
||||
#if defined(LLVM_BUILD_STATIC) || !defined(LLVM_ENABLE_LLVM_EXPORT_ANNOTATIONS)
|
||||
#define DEMANGLE_ABI
|
||||
#else
|
||||
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||
#if defined(LLVM_EXPORTS)
|
||||
#define DEMANGLE_ABI __declspec(dllexport)
|
||||
#else
|
||||
#define DEMANGLE_ABI __declspec(dllimport)
|
||||
#endif
|
||||
#else
|
||||
#if __has_attribute(visibility)
|
||||
#define DEMANGLE_ABI __attribute__((__visibility__("default")))
|
||||
#else
|
||||
#define DEMANGLE_ABI
|
||||
#endif
|
||||
#endif
|
||||
// clang-format off
|
||||
// Autoformatting removes indentation, making this harder to read.
|
||||
#if !defined(DEMANGLE_ABI)
|
||||
# if defined(LLVM_BUILD_STATIC) || !defined(LLVM_ENABLE_LLVM_EXPORT_ANNOTATIONS)
|
||||
# define DEMANGLE_ABI
|
||||
# else
|
||||
# if defined(_WIN32) && !defined(__MINGW32__)
|
||||
# if defined(LLVM_EXPORTS)
|
||||
# define DEMANGLE_ABI __declspec(dllexport)
|
||||
# else
|
||||
# define DEMANGLE_ABI __declspec(dllimport)
|
||||
# endif
|
||||
# else
|
||||
# if __has_attribute(visibility)
|
||||
# define DEMANGLE_ABI __attribute__((__visibility__("default")))
|
||||
# else
|
||||
# define DEMANGLE_ABI
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
// clang-format on
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class Node;
|
|||
|
||||
// Stream that AST nodes write their string representation into after the AST
|
||||
// has been parsed.
|
||||
class OutputBuffer {
|
||||
class DEMANGLE_ABI OutputBuffer {
|
||||
char *Buffer = nullptr;
|
||||
size_t CurrentPosition = 0;
|
||||
size_t BufferCapacity = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue