[PATCH] D121855: [scudo] Fix static and unused function type annotations

Dominic Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 17 10:35:18 PDT 2022


ddcc updated this revision to Diff 416242.
ddcc marked an inline comment as done.
ddcc added a comment.

Remove unneeded static


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121855/new/

https://reviews.llvm.org/D121855

Files:
  compiler-rt/lib/scudo/standalone/size_class_map.h
  compiler-rt/lib/scudo/standalone/tests/checksum_test.cpp
  compiler-rt/lib/scudo/standalone/tsd_exclusive.h


Index: compiler-rt/lib/scudo/standalone/tsd_exclusive.h
===================================================================
--- compiler-rt/lib/scudo/standalone/tsd_exclusive.h
+++ compiler-rt/lib/scudo/standalone/tsd_exclusive.h
@@ -87,7 +87,7 @@
     Mutex.unlock();
   }
 
-  bool setOption(Option O, UNUSED sptr Value) {
+  bool setOption(Option O, sptr Value) {
     if (O == Option::ThreadDisableMemInit)
       State.DisableMemInit = Value;
     if (O == Option::MaxTSDsCount)
Index: compiler-rt/lib/scudo/standalone/tests/checksum_test.cpp
===================================================================
--- compiler-rt/lib/scudo/standalone/tests/checksum_test.cpp
+++ compiler-rt/lib/scudo/standalone/tests/checksum_test.cpp
@@ -12,16 +12,16 @@
 
 #include <string.h>
 
-scudo::u16 computeSoftwareChecksum(scudo::u32 Seed, scudo::uptr *Array,
-                                   scudo::uptr ArraySize) {
+static scudo::u16 computeSoftwareChecksum(scudo::u32 Seed, scudo::uptr *Array,
+                                          scudo::uptr ArraySize) {
   scudo::u16 Checksum = static_cast<scudo::u16>(Seed & 0xffff);
   for (scudo::uptr I = 0; I < ArraySize; I++)
     Checksum = scudo::computeBSDChecksum(Checksum, Array[I]);
   return Checksum;
 }
 
-scudo::u16 computeHardwareChecksum(scudo::u32 Seed, scudo::uptr *Array,
-                                   scudo::uptr ArraySize) {
+static scudo::u16 computeHardwareChecksum(scudo::u32 Seed, scudo::uptr *Array,
+                                          scudo::uptr ArraySize) {
   scudo::u32 Crc = Seed;
   for (scudo::uptr I = 0; I < ArraySize; I++)
     Crc = scudo::computeHardwareCRC32(Crc, Array[I]);
Index: compiler-rt/lib/scudo/standalone/size_class_map.h
===================================================================
--- compiler-rt/lib/scudo/standalone/size_class_map.h
+++ compiler-rt/lib/scudo/standalone/size_class_map.h
@@ -345,7 +345,7 @@
   Buffer.output();
 }
 
-template <typename SCMap> static void validateMap() {
+template <typename SCMap> static UNUSED void validateMap() {
   for (uptr C = 0; C < SCMap::NumClasses; C++) {
     if (C == SCMap::BatchClassId)
       continue;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121855.416242.patch
Type: text/x-patch
Size: 2172 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220317/d61d5a58/attachment.bin>


More information about the llvm-commits mailing list