[PATCH] D32097: Remove getInstrProf*SectionName helpers as an API cleanup, NFC.

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 14 15:01:39 PDT 2017


vsk created this revision.

This is a version of https://reviews.llvm.org/D32090 [1] that removes all of the `getInstrProf*SectionName` helper functions. The build failures which https://reviews.llvm.org/D32090 would have addressed were fixed with https://reviews.llvm.org/D32073 [2].

I think we should remove these helper functions because they are hard to maintain and use. E.g we had to introduce more helpers to fix our COFF support. The current scheme doesn't totally succeed at hiding low-level details about the section naming scheme from clients, so I think we should move to a more flexible API. We can clean things up by unifying the various helpers into function which accepts an ObjectFileFormat instead of a mix of llvm::Module and bools.

There is a compiler-rt change not shown here (we have to sync up the copies of InstrProfData.inc). There is also one clang change:

   std::string getCoverageSection(const CodeGenModule &CGM) {
  -  return llvm::getInstrProfCoverageSectionName(&CGM.getModule());
  +  return llvm::getInstrProfSectionName(
  +      llvm::IPSK_covmap,
  +      CGM.getContext().getTargetInfo().getTriple().getObjectFormat());
   }

Testing: check-clang, check-profile, check-llvm. I haven't tested this on Windows.

[1] https://reviews.llvm.org/D32090
[InstrProf] Fix Windows cross compilation TODOs to fix failing tests

[2] https://reviews.llvm.org/D32073
[ProfileData] Support cross target binary reading for coverage tool


https://reviews.llvm.org/D32097

Files:
  include/llvm/Object/Binary.h
  include/llvm/ProfileData/InstrProf.h
  include/llvm/ProfileData/InstrProfData.inc
  include/llvm/Transforms/InstrProfiling.h
  lib/CodeGen/TargetLoweringObjectFileImpl.cpp
  lib/ProfileData/Coverage/CoverageMappingReader.cpp
  lib/ProfileData/InstrProf.cpp
  lib/Transforms/Instrumentation/InstrProfiling.cpp
  lib/Transforms/Instrumentation/ThreadSanitizer.cpp
  tools/llvm-cov/TestingSupport.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32097.95351.patch
Type: text/x-patch
Size: 17341 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170414/3b35c42a/attachment.bin>


More information about the llvm-commits mailing list