Skip to content

Commit 96a3b78

Browse files
committed
[flang] Make runtimes headers independent of the main llvm headers
llvm/Support/Compiler.h requires llvm-config.h, i.e. to include it, you'd need to actually set up building llvm for that target. If using flang to cross compile code for a different target, we need the runtimes built for that target, but we might not want to build llvm itself for that target. This is one out of two essential steps for building the flang runtimes for a foreign target, i.e. setting up cross compiling with flang. Differential Revision: https://reviews.llvm.org/D130351
1 parent 0565e65 commit 96a3b78

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

flang/include/flang/Common/idioms.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#endif
2525

2626
#include "visit.h"
27-
#include "llvm/Support/Compiler.h"
2827
#include <functional>
2928
#include <list>
3029
#include <memory>
@@ -125,11 +124,11 @@ template <typename A> struct ListItemCount {
125124

126125
#define ENUM_CLASS(NAME, ...) \
127126
enum class NAME { __VA_ARGS__ }; \
128-
LLVM_ATTRIBUTE_UNUSED static constexpr std::size_t NAME##_enumSize{[] { \
127+
[[maybe_unused]] static constexpr std::size_t NAME##_enumSize{[] { \
129128
enum { __VA_ARGS__ }; \
130129
return Fortran::common::ListItemCount{__VA_ARGS__}.value; \
131130
}()}; \
132-
LLVM_ATTRIBUTE_UNUSED static inline std::string EnumToString(NAME e) { \
131+
[[maybe_unused]] static inline std::string EnumToString(NAME e) { \
133132
return Fortran::common::EnumIndexToString( \
134133
static_cast<int>(e), #__VA_ARGS__); \
135134
}

0 commit comments

Comments
 (0)