This is an archive of the discontinued LLVM Phabricator instance.

[GWP-ASan] Cleanup (NFC)
ClosedPublic

Authored by cryptoad on Oct 19 2020, 11:55 AM.

Details

Summary

Cleaning up some of the GWP-ASan code base:

  • lots of headers didn't have the correct file name
  • adding #ifdef guard to utilities.h
  • correcting an #ifdef guard based on actual file name
  • removing an extra ;
  • clang-format'ing the code (-style=llvm)

Diff Detail

Event Timeline

cryptoad created this revision.Oct 19 2020, 11:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 19 2020, 11:55 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
cryptoad requested review of this revision.Oct 19 2020, 11:55 AM
hctim accepted this revision.Oct 19 2020, 12:17 PM

LGTM w/ one discrepancy

compiler-rt/lib/gwp_asan/platform_specific/utilities_posix.cpp
31

my clang-format --style=LLVM uses doublespace after #else as well, but not after #endif. hmm...

This revision is now accepted and ready to land.Oct 19 2020, 12:17 PM
cryptoad added inline comments.Oct 19 2020, 12:39 PM
compiler-rt/lib/gwp_asan/platform_specific/utilities_posix.cpp
31

I tried a few combinations, with a gLinux stock clang-format, a freshly compiled one from ToT, and they all end up with 1 space.
The one at the top of the file for stdio also has 1 space.

Not sure what's the deal with that pre-merge check.

hctim added inline comments.Oct 19 2020, 12:44 PM
compiler-rt/lib/gwp_asan/platform_specific/utilities_posix.cpp
31

Maybe me and the mergebot have our binaries from a bad revision. Let me check.

hctim added a comment.Oct 19 2020, 1:18 PM

LGTM

compiler-rt/lib/gwp_asan/platform_specific/utilities_posix.cpp
31
$ clang-format --version
clang-format version 10.0.0 (https://github.com/llvm/llvm-project.git af57dbf12e54f3a8ff48534bf1078f4de104c1cd)
$ clang-format z.cpp | grep BIONIC
#ifdef __BIONIC__
#else  // __BIONIC__ <-- two spaces
#endif // __BIONIC__
$ tip/of/tree/clang-format --version
clang-format version 12.0.0 (https://github.com/llvm/llvm-project.git 9776ac7c10c77e05ef1a7427b526e2f1f8f3c9c2)
$ tip/of/tree/clang-format z.cpp | grep BIONIC
#ifdef __BIONIC__
#else // __BIONIC__ <-- one space
#endif // __BIONIC__

LGTM, prefer new formatter to old

This revision was landed with ongoing or failed builds.Oct 19 2020, 6:13 PM
This revision was automatically updated to reflect the committed changes.