Page MenuHomePhabricator

[TSan][libdispatch] Remove dependency on system headers

Authored by yln on Mar 8 2019, 11:40 AM.



Including <dispatch/dispatch.h> and <Blocks.h> transitively pulls in
other system headers. Let's try to avoid that.

Blocks.h: compiler-rt already includes a blocks runtime. Just use the
header file that comes with it.

dispatch.h: Declare the bare minimum required for our implementation,
i.e., everything needed to define the interceptors, but not the
interceptors themselves. See tsan_dispatch_defs.h. I spotted a few other
places in compile-rt, where we declare libdispatch types. Maybe this
file can be moved to sanitizer_common if we deem it useful enough. now compiles on Linux/Clang (requires support for
-fblocks). Linking still requires some manual configuration.

Diff Detail


Event Timeline

yln created this revision.Mar 8 2019, 11:40 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMar 8 2019, 11:40 AM
Herald added subscribers: llvm-commits, Restricted Project, jdoerfert, kubamracek. · View Herald Transcript
kubamracek accepted this revision.Mar 14 2019, 1:10 PM

Looks good, with a nit (feel free to address it separately).

53–56 ↗(On Diff #189896)

Can we just unconditionally define DISPATCH_NOESCAPE now that we don't include the system header?

This revision is now accepted and ready to land.Mar 14 2019, 1:10 PM
yln marked 2 inline comments as done.Mar 14 2019, 1:22 PM
yln added inline comments.
53–56 ↗(On Diff #189896)
This revision was automatically updated to reflect the committed changes.
yln marked an inline comment as done.