[llvm-branch-commits] [llvm] 32e2000 - [NFC][llvm][support] rename INFINITY in regcomp (#101758)
Tobias Hieta via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Sat Aug 10 03:13:32 PDT 2024
Author: David Tenty
Date: 2024-08-10T12:13:21+02:00
New Revision: 32e20009d1943e2f6cd6f55c6ec6a23dcd094337
URL: https://github.com/llvm/llvm-project/commit/32e20009d1943e2f6cd6f55c6ec6a23dcd094337
DIFF: https://github.com/llvm/llvm-project/commit/32e20009d1943e2f6cd6f55c6ec6a23dcd094337.diff
LOG: [NFC][llvm][support] rename INFINITY in regcomp (#101758)
since C23 this macro is defined by float.h, which clang implements in
it's float.h since #96659 landed.
However, regcomp.c in LLVMSupport happened to define it's own macro with
that name, leading to problems when bootstrapping. This change renames
the offending macro.
(cherry picked from commit 899f648866affd011baae627752ba15baabc2ef9)
Added:
Modified:
llvm/lib/Support/regcomp.c
Removed:
################################################################################
diff --git a/llvm/lib/Support/regcomp.c b/llvm/lib/Support/regcomp.c
index 990aef32a396fa..daa41eb4912ef4 100644
--- a/llvm/lib/Support/regcomp.c
+++ b/llvm/lib/Support/regcomp.c
@@ -278,7 +278,7 @@ static char nuls[10]; /* place to point scanner in event of error */
#else
#define DUPMAX 255
#endif
-#define INFINITY (DUPMAX + 1)
+#define REGINFINITY (DUPMAX + 1)
#ifndef NDEBUG
static int never = 0; /* for use in asserts; shuts lint up */
@@ -582,7 +582,7 @@ p_ere_exp(struct parse *p)
count2 = p_count(p);
REQUIRE(count <= count2, REG_BADBR);
} else /* single number with comma */
- count2 = INFINITY;
+ count2 = REGINFINITY;
} else /* just a single number */
count2 = count;
repeat(p, pos, count, count2);
@@ -753,7 +753,7 @@ p_simp_re(struct parse *p,
count2 = p_count(p);
REQUIRE(count <= count2, REG_BADBR);
} else /* single number with comma */
- count2 = INFINITY;
+ count2 = REGINFINITY;
} else /* just a single number */
count2 = count;
repeat(p, pos, count, count2);
@@ -1115,7 +1115,7 @@ repeat(struct parse *p,
# define N 2
# define INF 3
# define REP(f, t) ((f)*8 + (t))
-# define MAP(n) (((n) <= 1) ? (n) : ((n) == INFINITY) ? INF : N)
+# define MAP(n) (((n) <= 1) ? (n) : ((n) == REGINFINITY) ? INF : N)
sopno copy;
if (p->error != 0) /* head off possible runaway recursion */
More information about the llvm-branch-commits
mailing list