Skip to content

Commit

Permalink
Fix compiler errors from clang versions older than 15 not supporting …
Browse files Browse the repository at this point in the history
…gnu style attributes on namespaces

Fixes errors in GVN.h after changes in llvm#96630 to how LLVM_LIBRARY_VISIBILITY is defined
  • Loading branch information
fsfod committed Sep 6, 2024
1 parent 7f77db4 commit b6606c2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions llvm/include/llvm/Support/Compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,12 @@

#if (!(defined(_WIN32) || defined(__CYGWIN__)) || \
(defined(__MINGW32__) && defined(__clang__)))
// Clang compilers older then 15 do not support gnu style attributes on namespaces
#if defined(__clang__) && _clang_major__ < 15
#define LLVM_LIBRARY_VISIBILITY [[gnu::visibility("hidden")]]
#else
#define LLVM_LIBRARY_VISIBILITY LLVM_ATTRIBUTE_VISIBILITY_HIDDEN
#endif
#define LLVM_ALWAYS_EXPORT LLVM_ATTRIBUTE_VISIBILITY_DEFAULT
#elif defined(_WIN32)
#define LLVM_ALWAYS_EXPORT __declspec(dllexport)
Expand Down

0 comments on commit b6606c2

Please sign in to comment.