This is an archive of the discontinued LLVM Phabricator instance.

[lsan] Factor pthread-specific assumptions out of thread tracking code
ClosedPublic

Authored by mcgrathr on Jan 23 2020, 4:49 PM.

Details

Summary

This is a small refactoring to prepare for porting LSan to Fuchsia.
Factor out parts of lsan_thread.{cpp,h} that don't apply to Fuchsia.
Since existing supported systems are POSIX-based, the affected code
is moved to lsan_posix.{cpp.h}.

Event Timeline

mcgrathr created this revision.Jan 23 2020, 4:49 PM
vitalybuka accepted this revision.Jan 24 2020, 1:41 AM
vitalybuka added inline comments.
compiler-rt/lib/lsan/lsan_posix.cpp
31

can you make it more consistent?
type name1;
type name2;
...

65

is this clang-formated?

compiler-rt/lib/lsan/lsan_posix.h
39

same about one per line

compiler-rt/lib/lsan/lsan_thread.h
35

maybe here and else
just
uptr stack_begin_ = 0;

This revision is now accepted and ready to land.Jan 24 2020, 1:41 AM
mcgrathr updated this revision to Diff 240320.Jan 24 2020, 4:17 PM
mcgrathr marked 2 inline comments as done.

Style changes to copied code, clang-format.

mcgrathr marked 3 inline comments as done.Jan 24 2020, 4:23 PM

I've made the style changes you asked for and clang-format'd the files I touched. But note that all of these changes are to existing code that I just moved and left exactly as it had been and not anything I'd added. I erred on the side of leaving things alone rather than cleaning them up. I've now done the opposite as you asked, though it's not entirely consistent with the style and formatting of the existing code in the same directory. I'm happy to use whatever style choices you prefer, but it's easiest to do that when the codebase is consistent with those choices already.

compiler-rt/lib/lsan/lsan_posix.cpp
31

Consistent with what?
I'm happy to use whatever style rules you prefer.
But there's no sign that one-declaration-per-line is the prevailing sign in the existing codebase.

I'm changing this as you asked, but it was verbatim moved from the existing code in the other file and all the style choices were not mine.

65

It was moved verbatim from the old code.

This revision was automatically updated to reflect the committed changes.