https://github.com/serge-sans-paille closed
https://github.com/llvm/llvm-project/pull/114818
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/nikic approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/114818
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
serge-sans-paille wrote:
Should be good now. thanks for the reviews @nikic & @arsenm
https://github.com/llvm/llvm-project/pull/114818
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -8,6 +8,7 @@ int stpncpy;
int strdup;
int strndup;
int index;
+int reallocarray;
nikic wrote:
This change probably shouldn't be here anymore?
https://github.com/llvm/llvm-project/pull/114818
___
cfe-commits maili
https://github.com/serge-sans-paille updated
https://github.com/llvm/llvm-project/pull/114818
>From a1ca0d1e0cbc2f1c5eb09639a687f0eed6f6826c Mon Sep 17 00:00:00 2001
From: serge-sans-paille
Date: Mon, 4 Nov 2024 16:50:45 +0100
Subject: [PATCH 1/3] [TLI] Add support for reallocarray
>From the m
@@ -852,6 +852,7 @@ static void initializeLibCalls(TargetLibraryInfoImpl &TLI,
const Triple &T,
TLI.setUnavailable(LibFunc_memrchr);
TLI.setUnavailable(LibFunc_ntohl);
TLI.setUnavailable(LibFunc_ntohs);
+TLI.setUnavailable(LibFunc_reallocarray);
---
@@ -852,6 +852,7 @@ static void initializeLibCalls(TargetLibraryInfoImpl &TLI,
const Triple &T,
TLI.setUnavailable(LibFunc_memrchr);
TLI.setUnavailable(LibFunc_ntohl);
TLI.setUnavailable(LibFunc_ntohs);
+TLI.setUnavailable(LibFunc_reallocarray);
---
https://github.com/serge-sans-paille updated
https://github.com/llvm/llvm-project/pull/114818
>From a1ca0d1e0cbc2f1c5eb09639a687f0eed6f6826c Mon Sep 17 00:00:00 2001
From: serge-sans-paille
Date: Mon, 4 Nov 2024 16:50:45 +0100
Subject: [PATCH 1/2] [TLI] Add support for reallocarray
>From the m
@@ -3224,6 +3224,13 @@ def AllocA : GNULibBuiltin<"stdlib.h"> {
let AddBuiltinPrefixedAlias = 1;
}
+// Available in glibc by default since since 2.29 and in GNU mode before.
+def ReallocArray : GNULibBuiltin<"stdlib.h"> {
arsenm wrote:
The clang builtin cha
@@ -577,6 +577,21 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
Changed |= setDoesNotCapture(F, 0);
Changed |= setArgNoUndef(F, 1);
break;
+ case LibFunc_reallocarray:
+Changed |= setAllocFamily(F, "malloc");
+Changed |= setAllocKind(F, AllocFnKi
@@ -852,6 +852,7 @@ static void initializeLibCalls(TargetLibraryInfoImpl &TLI,
const Triple &T,
TLI.setUnavailable(LibFunc_memrchr);
TLI.setUnavailable(LibFunc_ntohl);
TLI.setUnavailable(LibFunc_ntohs);
+TLI.setUnavailable(LibFunc_reallocarray);
---
https://github.com/serge-sans-paille updated
https://github.com/llvm/llvm-project/pull/114818
>From a1ca0d1e0cbc2f1c5eb09639a687f0eed6f6826c Mon Sep 17 00:00:00 2001
From: serge-sans-paille
Date: Mon, 4 Nov 2024 16:50:45 +0100
Subject: [PATCH] [TLI] Add support for reallocarray
>From the man p
@@ -852,6 +852,7 @@ static void initializeLibCalls(TargetLibraryInfoImpl &TLI,
const Triple &T,
TLI.setUnavailable(LibFunc_memrchr);
TLI.setUnavailable(LibFunc_ntohl);
TLI.setUnavailable(LibFunc_ntohs);
+TLI.setUnavailable(LibFunc_reallocarray);
---
https://github.com/serge-sans-paille updated
https://github.com/llvm/llvm-project/pull/114818
>From f3447843eeb0259161b12f26854e628a00e6e156 Mon Sep 17 00:00:00 2001
From: serge-sans-paille
Date: Mon, 4 Nov 2024 16:50:45 +0100
Subject: [PATCH] [TLI] Add support for reallocarray
>From the man p
@@ -852,6 +852,7 @@ static void initializeLibCalls(TargetLibraryInfoImpl &TLI,
const Triple &T,
TLI.setUnavailable(LibFunc_memrchr);
TLI.setUnavailable(LibFunc_ntohl);
TLI.setUnavailable(LibFunc_ntohs);
+TLI.setUnavailable(LibFunc_reallocarray);
---
https://github.com/serge-sans-paille updated
https://github.com/llvm/llvm-project/pull/114818
>From e7d67f36df2424e78b1cc3ad19d6c3a6e5553dec Mon Sep 17 00:00:00 2001
From: serge-sans-paille
Date: Mon, 4 Nov 2024 16:50:45 +0100
Subject: [PATCH] [TLI] Add support for reallocarray
reallocarray is
@@ -318,6 +318,7 @@ TEST_F(TargetLibraryInfoTest, ValidProto) {
"declare void @qsort(i8*, i64, i64, i32 (i8*, i8*)*)\n"
"declare i64 @readlink(i8*, i8*, i64)\n"
"declare i8* @realloc(i8*, i64)\n"
+ "declare i8* @reallocarray(i8*, i64, i64)\n"
@@ -318,6 +318,7 @@ TEST_F(TargetLibraryInfoTest, ValidProto) {
"declare void @qsort(i8*, i64, i64, i32 (i8*, i8*)*)\n"
"declare i64 @readlink(i8*, i8*, i64)\n"
"declare i8* @realloc(i8*, i64)\n"
+ "declare i8* @reallocarray(i8*, i64, i64)\n"
@@ -318,6 +318,7 @@ TEST_F(TargetLibraryInfoTest, ValidProto) {
"declare void @qsort(i8*, i64, i64, i32 (i8*, i8*)*)\n"
"declare i64 @readlink(i8*, i8*, i64)\n"
"declare i8* @realloc(i8*, i64)\n"
+ "declare i8* @reallocarray(i8*, i64, i64)\n"
https://github.com/serge-sans-paille created
https://github.com/llvm/llvm-project/pull/114818
reallocarray is available in glibc since 2.29 under _DEFAULT_SOURCE and under
_GNU_SOURCE before, let's model it appropriately.
>From c46cdf6b3debe50fc0611c93ec3a1de33d4f472b Mon Sep 17 00:00:00 2001
llvmbot wrote:
@llvm/pr-subscribers-llvm-analysis
@llvm/pr-subscribers-llvm-transforms
Author: None (serge-sans-paille)
Changes
reallocarray is available in glibc since 2.29 under _DEFAULT_SOURCE and under
_GNU_SOURCE before, let's model it appropriately.
---
Full diff: https://github.co
21 matches
Mail list logo