This is an archive of the discontinued LLVM Phabricator instance.

[Fuchsia] Rely on linker switch rather than dead code ref for profile runtime
ClosedPublic

Authored by mcgrathr on May 12 2020, 6:54 PM.

Details

Summary

Follow the model used on Linux, where the clang driver passes the
linker a -u switch to force the profile runtime to be linked in,
rather than having every TU emit a dead function with a reference.

Diff Detail

Event Timeline

mcgrathr created this revision.May 12 2020, 6:54 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMay 12 2020, 6:54 PM
phosek accepted this revision.May 29 2020, 2:10 AM

LGTM

llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
1037

Nit: s/for linux/for Linux or Fuchsia/

This revision is now accepted and ready to land.May 29 2020, 2:10 AM
mcgrathr updated this revision to Diff 267336.May 29 2020, 12:36 PM

comment update

mcgrathr marked an inline comment as done.May 29 2020, 12:36 PM
MaskRay added inline comments.
clang/lib/Driver/ToolChains/Fuchsia.cpp
372

Thanks. I just realized Linux::addProfileRTLibs can be simplified.

This revision was automatically updated to reflect the committed changes.