Skip to content

Commit b8ab5f5

Browse files
committed
simply alias DEMANBLE_ABI to LLVM_ABI when building llvm
1 parent 4447491 commit b8ab5f5

File tree

2 files changed

+5
-24
lines changed

2 files changed

+5
-24
lines changed

llvm/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,10 +1071,9 @@ if (LLVM_BUILD_LLVM_DYLIB OR LLVM_BUILD_SHARED_LIBS OR LLVM_ENABLE_PLUGINS)
10711071
set(LLVM_ENABLE_LLVM_EXPORT_ANNOTATIONS ON)
10721072
endif()
10731073

1074-
# Because LLVM-C and Demangle libraries are built into the LLVM library, for now
1075-
# we export their symbols if LLVM symbols are exported.
1074+
# Because LLVM-C is built into the LLVM library, for now export its symbols
1075+
# whenever LLVM symbols are exported.
10761076
set(LLVM_ENABLE_LLVM_C_EXPORT_ANNOTATIONS ${LLVM_ENABLE_LLVM_EXPORT_ANNOTATIONS})
1077-
set(LLVM_ENABLE_DEMANGLE_EXPORT_ANNOTATIONS ${LLVM_ENABLE_LLVM_EXPORT_ANNOTATIONS})
10781077

10791078
set(LLVM_ENABLE_NEW_PASS_MANAGER TRUE CACHE BOOL
10801079
"Enable the new pass manager by default.")

llvm/include/llvm/Demangle/Visibility.h

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,10 @@
1616
#ifndef LLVM_DEMANGLE_VISIBILITY_H
1717
#define LLVM_DEMANGLE_VISIBILITY_H
1818

19-
#include "llvm/Config/llvm-config.h"
20-
#include "llvm/Demangle/DemangleConfig.h"
19+
#include "llvm/Support/Compiler.h"
2120

2221
/// DEMANGLE_ABI is the export/visibility macro used to mark symbols delcared in
23-
/// llvm/Demangle as exported when built as a shared library.
24-
25-
#if !defined(LLVM_ABI_GENERATING_ANNOTATIONS)
26-
#if defined(LLVM_ENABLE_DEMANGLE_EXPORT_ANNOTATIONS) && \
27-
!defined(LLVM_BUILD_STATIC)
28-
#if defined(_WIN32) && !defined(__MINGW32__)
29-
#if defined(LLVM_EXPORTS)
30-
#define DEMANGLE_ABI __declspec(dllexport)
31-
#else
32-
#define DEMANGLE_ABI __declspec(dllimport)
33-
#endif
34-
#elif __has_attribute(visibility)
35-
#define DEMANGLE_ABI __attribute__((visibility("default")))
36-
#endif
37-
#endif
38-
#if !defined(DEMANGLE_ABI)
39-
#define DEMANGLE_ABI
40-
#endif
41-
#endif
22+
/// llvm/Demangle as exported when LLVM is built as a shared library.
23+
#define DEMANGLE_ABI LLVM_ABI
4224

4325
#endif

0 commit comments

Comments
 (0)