[PATCH] D135340: [PGO] Make emitted symbols hidden

Alex Brachet via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 17 23:07:46 PDT 2022


abrachet updated this revision to Diff 468425.
abrachet added a comment.

The error @zequanwu ran into happens only on MacOS because it this Darwin-only test happens to be the only one that tests instrprof with no code. `__llvm_profile_filename` doesn't get emitted in this case so it ends up pulling in the one in libprofile.a which is not hidden. I've changed this to make `__llvm_profile_filename` hidden, as well as `__llvm_profile_raw_version` even though that symbol is always emitted.

@cishida, to verify, the comment in InstrProfilingVersionVar.c said that `__llvm_profile_raw_version` was not hidden on Apple platforms because of TAPI, it should be ok to mark this as hidden in libprofile.a, right? I'm guessing this should be no different than when the symbol is emitted by llvm.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135340/new/

https://reviews.llvm.org/D135340

Files:
  clang/lib/Driver/ToolChains/Darwin.cpp
  clang/test/Driver/darwin-ld.c
  compiler-rt/lib/profile/InstrProfilingNameVar.c
  compiler-rt/lib/profile/InstrProfilingVersionVar.c
  llvm/lib/ProfileData/InstrProf.cpp
  llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
  llvm/test/Transforms/PGOProfile/branch1.ll
  llvm/test/Transforms/PGOProfile/branch2.ll
  llvm/test/Transforms/PGOProfile/comdat_internal.ll
  llvm/test/Transforms/PGOProfile/criticaledge.ll
  llvm/test/Transforms/PGOProfile/instr_entry_bb.ll
  llvm/test/Transforms/PGOProfile/landingpad.ll
  llvm/test/Transforms/PGOProfile/loop1.ll
  llvm/test/Transforms/PGOProfile/loop2.ll
  llvm/test/Transforms/PGOProfile/lto_cspgo_gen.ll
  llvm/test/Transforms/PGOProfile/single_bb.ll
  llvm/test/Transforms/PGOProfile/switch.ll
  llvm/test/Transforms/PGOProfile/thinlto_cspgo_gen.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135340.468425.patch
Type: text/x-patch
Size: 13658 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221018/29aa191c/attachment.bin>


More information about the cfe-commits mailing list