Skip to content

Commit e4ec381

Browse files
rorthtstellar
authored andcommitted
[mlir] Fix Analysis/Presburger/Utils.cpp compilation with GCC 11
As reported in Issue #56850, mlir/lib/Analysis/Presburger/Utils.cpp doesn't compile on Solaris 11.4/SPARC with the bundled GCC 11, as seen when testing LLVM 15.0.0 rc1: /var/llvm/reltest/llvm-15.0.0-rc1/rc1/llvm-project/mlir/include/mlir/Analysis/Presburger/MPInt.h:260:47: error: inlining failed in call to ‘always_inline’ ‘int64_t mlir::presburger::int64FromMPInt(const mlir::presburger::MPInt&)’: indirect function call with a yet undetermined callee This patch hacks around this and allowed the build to finish. Tested on `sparcv9-sun-solaris2.11`. Differential Revision: https://reviews.llvm.org/D131060 (cherry picked from commit 75747e6)
1 parent 3d39cec commit e4ec381

File tree

1 file changed

+1
-3
lines changed
  • mlir/include/mlir/Analysis/Presburger

1 file changed

+1
-3
lines changed

mlir/include/mlir/Analysis/Presburger/MPInt.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,7 @@ llvm::hash_code hash_value(const MPInt &x); // NOLINT
257257
/// This just calls through to the operator int64_t, but it's useful when a
258258
/// function pointer is required. (Although this is marked inline, it is still
259259
/// possible to obtain and use a function pointer to this.)
260-
LLVM_ATTRIBUTE_ALWAYS_INLINE int64_t int64FromMPInt(const MPInt &x) {
261-
return int64_t(x);
262-
}
260+
static inline int64_t int64FromMPInt(const MPInt &x) { return int64_t(x); }
263261
LLVM_ATTRIBUTE_ALWAYS_INLINE MPInt mpintFromInt64(int64_t x) {
264262
return MPInt(x);
265263
}

0 commit comments

Comments
 (0)