Add helper functions and remove hard coded references to instProf related name/name-prefixes

This is a clean up patch that defines instr prof section and variable 
name prefixes in a common header with access helper functions. 
clang FE change will be done as a follow up once this patch is in.

Differential Revision: http://reviews.llvm.org/D13919

llvm-svn: 251058
This commit is contained in:
Xinliang David Li
2015-10-22 20:32:12 +00:00
parent e0675fb8fb
commit 83bc4220ce
3 changed files with 50 additions and 14 deletions

View File

@@ -477,10 +477,11 @@ static std::error_code loadBinaryFormat(MemoryBufferRef ObjectBuffer,
: support::endianness::big;
// Look for the sections that we are interested in.
auto NamesSection = lookupSection(*OF, "__llvm_prf_names");
auto NamesSection = lookupSection(*OF, getInstrProfNameSectionName(false));
if (auto EC = NamesSection.getError())
return EC;
auto CoverageSection = lookupSection(*OF, "__llvm_covmap");
auto CoverageSection =
lookupSection(*OF, getInstrProfCoverageSectionName(false));
if (auto EC = CoverageSection.getError())
return EC;