This is an archive of the discontinued LLVM Phabricator instance.

[GWP-ASan] IWYU & clang-format
ClosedPublic

Authored by hctim on Dec 4 2020, 2:07 PM.

Details

Summary

Run an IWYU pass and clang-format GWP-ASan code.

Diff Detail

Event Timeline

hctim requested review of this revision.Dec 4 2020, 2:07 PM
hctim created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptDec 4 2020, 2:07 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
hctim updated this revision to Diff 309649.Dec 4 2020, 2:08 PM

(wrong basis point)

mcgrathr accepted this revision.Dec 4 2020, 2:18 PM
mcgrathr added inline comments.
compiler-rt/lib/gwp_asan/platform_specific/common_posix.cpp
12

sys/syscall.h -> syscall.h may be an unintended change.
With (Linux) glibc they are exactly the same, but IIRC <sys/syscall.h> is the traditional name and I'm not sure if BSD has (or has always had) both.

This revision is now accepted and ready to land.Dec 4 2020, 2:18 PM
eugenis accepted this revision.Dec 4 2020, 2:25 PM

LGTM with nit

compiler-rt/lib/gwp_asan/platform_specific/common_posix.cpp
12

Yes, that's strange, is it a change from iwui, clang-format, or manual?

hctim added inline comments.Dec 4 2020, 2:39 PM
compiler-rt/lib/gwp_asan/platform_specific/common_posix.cpp
12

IWYU made the change:

/usr/local/google/home/mitchp/llvm/compiler-rt/lib/gwp_asan/platform_specific/common_posix.cpp should add these lines:
#include <syscall.h>          // for SYS_gettid

/usr/local/google/home/mitchp/llvm/compiler-rt/lib/gwp_asan/platform_specific/common_posix.cpp should remove these lines:
- #include <sys/syscall.h>  // lines 12-12

The full include-list for /usr/local/google/home/mitchp/llvm/compiler-rt/lib/gwp_asan/platform_specific/common_posix.cpp:
#include <stdint.h>           // for uint64_t
#include <syscall.h>          // for SYS_gettid
#include <unistd.h>           // for syscall
#include "gwp_asan/common.h"  // for getThreadID
---

I'm inclined to go with "whatever will make me not have to remember that IWYU hates this include" solution (which is syscall.h), unless we can think of anything that will break. LMK :).

hctim marked 2 inline comments as done.Dec 8 2020, 10:16 AM
hctim added inline comments.
compiler-rt/lib/gwp_asan/platform_specific/common_posix.cpp
12

(@eugenis - still LGTY?)

eugenis added inline comments.Dec 10 2020, 10:31 AM
compiler-rt/lib/gwp_asan/platform_specific/common_posix.cpp
12

I'd rather keep <sys/syscall.h> with an IWYU pragma.

hctim updated this revision to Diff 310968.Dec 10 2020, 11:36 AM
hctim marked an inline comment as done.
  • Switch back to sys/syscall.h and add related pragmas.
This revision was landed with ongoing or failed builds.Dec 10 2020, 12:48 PM
This revision was automatically updated to reflect the committed changes.