This is an archive of the discontinued LLVM Phabricator instance.

[profile] Hide some external symbols in InstrProfData.inc
ClosedPublic

Authored by vsk on Jun 7 2016, 6:55 PM.

Details

Summary

Add a new INSTR_PROF_VISIBILITY macro to InstrProfData.inc which can be used to set hidden visibility on functions in the instrprof runtime.

Diff Detail

Repository
rL LLVM

Event Timeline

vsk updated this revision to Diff 59986.Jun 7 2016, 6:55 PM
vsk retitled this revision from to [profile] Hide some external symbols in InstrProfData.inc.
vsk updated this object.
vsk added reviewers: davidxl, silvas.
vsk added a subscriber: llvm-commits.
davidxl edited edge metadata.Jun 7 2016, 7:07 PM

Since InstrProfData.inc is shared across runtime and LLVM, using COMPILER_RT_VISIBILITY there directly may not be a good idea.

I think we annotate those functions with a macro INSTR_PROF_VISIBILITY which defaults to empty string. In InstrProfilingValue.c where InstrProfData.inc is included with INSTR_PROF_COMMON_API_IMPL defined, also define

#define INSTR_PROF_VISIBILITY COMPILER_RT_VISIBILITY

silvas edited edge metadata.Jun 7 2016, 7:34 PM

Since InstrProfData.inc is shared across runtime and LLVM, using COMPILER_RT_VISIBILITY there directly may not be a good idea.

I think we annotate those functions with a macro INSTR_PROF_VISIBILITY which defaults to empty string. In InstrProfilingValue.c where InstrProfData.inc is included with INSTR_PROF_COMMON_API_IMPL defined, also define

#define INSTR_PROF_VISIBILITY COMPILER_RT_VISIBILITY

This sounds like the right approach.

vsk updated this revision to Diff 60051.Jun 8 2016, 9:30 AM
vsk updated this object.
vsk edited edge metadata.
  • Adopt David's suggested INSTR_PROF_VISIBILITY macro.
davidxl accepted this revision.Jun 8 2016, 9:43 AM
davidxl edited edge metadata.

please also update LLVM copy

This revision is now accepted and ready to land.Jun 8 2016, 9:43 AM
This revision was automatically updated to reflect the committed changes.