[Mlir-commits] [mlir] 78eeda7 - [MLIR][Presburger] Fix linkage of functions in header

Benjamin Kramer llvmlistbot at llvm.org
Tue Feb 8 08:52:27 PST 2022


Author: Benjamin Kramer
Date: 2022-02-08T17:51:34+01:00
New Revision: 78eeda7529e73b936dd46ac640756d8032bcc48b

URL: https://github.com/llvm/llvm-project/commit/78eeda7529e73b936dd46ac640756d8032bcc48b
DIFF: https://github.com/llvm/llvm-project/commit/78eeda7529e73b936dd46ac640756d8032bcc48b.diff

LOG: [MLIR][Presburger] Fix linkage of functions in header

Static functions in a header cause spurious unused function warnings.

Added: 
    

Modified: 
    mlir/unittests/Analysis/Presburger/Utils.h

Removed: 
    


################################################################################
diff  --git a/mlir/unittests/Analysis/Presburger/Utils.h b/mlir/unittests/Analysis/Presburger/Utils.h
index 3b42535a349b8..d1cfc91524659 100644
--- a/mlir/unittests/Analysis/Presburger/Utils.h
+++ b/mlir/unittests/Analysis/Presburger/Utils.h
@@ -24,7 +24,7 @@ namespace mlir {
 /// Parses a IntegerPolyhedron from a StringRef. It is expected that the
 /// string represents a valid IntegerSet, otherwise it will violate a gtest
 /// assertion.
-static IntegerPolyhedron parsePoly(StringRef str, MLIRContext *context) {
+inline IntegerPolyhedron parsePoly(StringRef str, MLIRContext *context) {
   FailureOr<IntegerPolyhedron> poly = parseIntegerSetToFAC(str, context);
   EXPECT_TRUE(succeeded(poly));
   return *poly;
@@ -32,7 +32,7 @@ static IntegerPolyhedron parsePoly(StringRef str, MLIRContext *context) {
 
 /// lhs and rhs represent non-negative integers or positive infinity. The
 /// infinity case corresponds to when the Optional is empty.
-static bool infinityOrUInt64LE(Optional<uint64_t> lhs, Optional<uint64_t> rhs) {
+inline bool infinityOrUInt64LE(Optional<uint64_t> lhs, Optional<uint64_t> rhs) {
   // No constraint.
   if (!rhs)
     return true;
@@ -45,7 +45,7 @@ static bool infinityOrUInt64LE(Optional<uint64_t> lhs, Optional<uint64_t> rhs) {
 /// Expect that the computed volume is a valid overapproximation of
 /// the true volume `trueVolume`, while also being at least as good an
 /// approximation as `resultBound`.
-static void
+inline void
 expectComputedVolumeIsValidOverapprox(Optional<uint64_t> computedVolume,
                                       Optional<uint64_t> trueVolume,
                                       Optional<uint64_t> resultBound) {


        


More information about the Mlir-commits mailing list