summaryrefslogtreecommitdiffstats
path: root/build/build-clang/llvmorg-17-init-6905-gc81a322476a1.patch
blob: 2e54236e05ff658a0d1f7d3c8a1b18dfb5525b6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
From c81a322476a1b1c57ca72832e10c43663557e097 Mon Sep 17 00:00:00 2001
From: Jie Fu <jiefu@tencent.com>
Date: Tue, 4 Apr 2023 07:40:34 +0800
Subject: [PATCH] [compiler-rt] Fix -Wcast-qual after D147005 (NFC)

/home/jiefu/llvm-project/compiler-rt/lib/lsan/lsan_allocator.cpp:161:18: error: cast from 'const void *' to 'void *' drops const qualifier [-Werror,-Wcast-qual]
  return (void *)beg;
                 ^
1 error generated.
---
 compiler-rt/lib/dfsan/dfsan_allocator.cpp | 2 +-
 compiler-rt/lib/lsan/lsan_allocator.cpp   | 2 +-
 compiler-rt/lib/msan/msan_allocator.cpp   | 2 +-
 compiler-rt/lib/tsan/rtl/tsan_mman.cpp    | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/compiler-rt/lib/dfsan/dfsan_allocator.cpp b/compiler-rt/lib/dfsan/dfsan_allocator.cpp
index cebf9983c9490..7ae6024fb2c9d 100644
--- a/compiler-rt/lib/dfsan/dfsan_allocator.cpp
+++ b/compiler-rt/lib/dfsan/dfsan_allocator.cpp
@@ -177,7 +177,7 @@ void *DFsanCalloc(uptr nmemb, uptr size) {
 void *AllocationBegin(const void *p) {
   if (!p)
     return nullptr;
-  const void *beg = allocator.GetBlockBegin(p);
+  void *beg = allocator.GetBlockBegin(p);
   if (!beg)
     return nullptr;
   Metadata *b = (Metadata *)allocator.GetMetaData(beg);
diff --git a/compiler-rt/lib/lsan/lsan_allocator.cpp b/compiler-rt/lib/lsan/lsan_allocator.cpp
index d50882657dc33..b0a54d7cd9bc5 100644
--- a/compiler-rt/lib/lsan/lsan_allocator.cpp
+++ b/compiler-rt/lib/lsan/lsan_allocator.cpp
@@ -148,7 +148,7 @@ void GetAllocatorCacheRange(uptr *begin, uptr *end) {
 void *GetMallocBegin(const void *p) {
   if (!p)
     return nullptr;
-  const void *beg = allocator.GetBlockBegin(p);
+  void *beg = allocator.GetBlockBegin(p);
   if (!beg)
     return nullptr;
   ChunkMetadata *m = Metadata(beg);
diff --git a/compiler-rt/lib/msan/msan_allocator.cpp b/compiler-rt/lib/msan/msan_allocator.cpp
index a760a434158a5..08ec3314b26e6 100644
--- a/compiler-rt/lib/msan/msan_allocator.cpp
+++ b/compiler-rt/lib/msan/msan_allocator.cpp
@@ -263,7 +263,7 @@ static void *MsanCalloc(StackTrace *stack, uptr nmemb, uptr size) {
 void *AllocationBegin(const void *p) {
   if (!p)
     return nullptr;
-  const void *beg = allocator.GetBlockBegin(p);
+  void *beg = allocator.GetBlockBegin(p);
   if (!beg)
     return nullptr;
   Metadata *b = (Metadata *)allocator.GetMetaData(beg);
diff --git a/compiler-rt/lib/tsan/rtl/tsan_mman.cpp b/compiler-rt/lib/tsan/rtl/tsan_mman.cpp
index 9c548dfff91f3..3cc4d16955ede 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_mman.cpp
+++ b/compiler-rt/lib/tsan/rtl/tsan_mman.cpp
@@ -355,7 +355,7 @@ void *user_pvalloc(ThreadState *thr, uptr pc, uptr sz) {
 void *user_alloc_begin(const void *p) {
   if (p == nullptr || !IsAppMem((uptr)p))
     return nullptr;
-  const void *beg = allocator()->GetBlockBegin(p);
+  void *beg = allocator()->GetBlockBegin(p);
   if (!beg)
     return nullptr;