[flang-commits] [flang] 96a3b78 - [flang] Make runtimes headers independent of the main llvm headers

Martin Storsjö via flang-commits flang-commits at lists.llvm.org
Tue Aug 23 07:26:17 PDT 2022


Author: Martin Storsjö
Date: 2022-08-23T17:25:20+03:00
New Revision: 96a3b78183579c78d3b20c707650794efceae422

URL: https://github.com/llvm/llvm-project/commit/96a3b78183579c78d3b20c707650794efceae422
DIFF: https://github.com/llvm/llvm-project/commit/96a3b78183579c78d3b20c707650794efceae422.diff

LOG: [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

Added: 
    

Modified: 
    flang/include/flang/Common/idioms.h

Removed: 
    


################################################################################
diff  --git a/flang/include/flang/Common/idioms.h b/flang/include/flang/Common/idioms.h
index 1a086162f1e2a..ac272d40fed67 100644
--- a/flang/include/flang/Common/idioms.h
+++ b/flang/include/flang/Common/idioms.h
@@ -24,7 +24,6 @@
 #endif
 
 #include "visit.h"
-#include "llvm/Support/Compiler.h"
 #include <functional>
 #include <list>
 #include <memory>
@@ -125,11 +124,11 @@ template <typename A> struct ListItemCount {
 
 #define ENUM_CLASS(NAME, ...) \
   enum class NAME { __VA_ARGS__ }; \
-  LLVM_ATTRIBUTE_UNUSED static constexpr std::size_t NAME##_enumSize{[] { \
+  [[maybe_unused]] static constexpr std::size_t NAME##_enumSize{[] { \
     enum { __VA_ARGS__ }; \
     return Fortran::common::ListItemCount{__VA_ARGS__}.value; \
   }()}; \
-  LLVM_ATTRIBUTE_UNUSED static inline std::string EnumToString(NAME e) { \
+  [[maybe_unused]] static inline std::string EnumToString(NAME e) { \
     return Fortran::common::EnumIndexToString( \
         static_cast<int>(e), #__VA_ARGS__); \
   }


        


More information about the flang-commits mailing list