[PATCH] D121848: [scudo] Remove unused header includes and fix declarations

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


ddcc added a comment.

Do you split want the non-`#include` changes split out?



================
Comment at: compiler-rt/lib/scudo/standalone/string_utils.cpp:13
 #include <stdarg.h>
-#include <string.h>
 
----------------
vitalybuka wrote:
> there is memset on :50
Same thing, `common.h` already provides it.


================
Comment at: compiler-rt/lib/scudo/standalone/vector.h:14
 
-#include <string.h>
-
----------------
vitalybuka wrote:
> it's used on :46
`common.h` includes `string.h` already, so this additional include is unnecessary. We have some custom library paths in our build system, so I needed to go through each include.


================
Comment at: compiler-rt/lib/scudo/standalone/wrappers_c.h:22
 
+extern "C" void malloc_postinit();
+extern scudo::Allocator<scudo::Config, malloc_postinit> Allocator;
----------------
vitalybuka wrote:
> Why do we need this?
`-Wmissing-variable-declarations` complains about no previous extern declaration for `Allocator` in `wrappers_c.cpp`, so the intention was to centralize the duplicate extern declarations between `wrappers_c.cpp` and `wrapper_cpp.cpp`, but I think that got lost while splitting the commits, and I missed that there's a `SCUDO_PREFIX` macro here, so I'll just add a declaration to `wrappers_c.cpp` instead.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121848



More information about the llvm-commits mailing list