From 4f4a18bb3335ec5bb31bdb7e14bf298d3e1afdb2 Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Thu, 2 Oct 2014 16:04:18 +0000 Subject: [PATCH] InstrProf: Update for the LLVM API change in r218879 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218880 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenPGO.cpp | 3 +-- lib/CodeGen/CoverageMappingGen.cpp | 9 +++------ lib/CodeGen/CoverageMappingGen.h | 10 +++------- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/lib/CodeGen/CodeGenPGO.cpp b/lib/CodeGen/CodeGenPGO.cpp index d341baf523..2f1f211b72 100644 --- a/lib/CodeGen/CodeGenPGO.cpp +++ b/lib/CodeGen/CodeGenPGO.cpp @@ -908,8 +908,7 @@ void CodeGenPGO::emitCounterRegionMapping(const Decl *D) { llvm::raw_string_ostream OS(CoverageMapping); CoverageMappingGen MappingGen(*CGM.getCoverageMapping(), CGM.getContext().getSourceManager(), - CGM.getLangOpts(), RegionCounterMap.get(), - NumRegionCounters); + CGM.getLangOpts(), RegionCounterMap.get()); MappingGen.emitCounterMapping(D, OS); OS.flush(); } diff --git a/lib/CodeGen/CoverageMappingGen.cpp b/lib/CodeGen/CoverageMappingGen.cpp index 2bfe0fb860..9900ebc014 100644 --- a/lib/CodeGen/CoverageMappingGen.cpp +++ b/lib/CodeGen/CoverageMappingGen.cpp @@ -581,11 +581,9 @@ struct CounterCoverageMappingBuilder CounterCoverageMappingBuilder( CoverageMappingModuleGen &CVM, - llvm::DenseMap &CounterMap, - unsigned NumRegionCounters, SourceManager &SM, + llvm::DenseMap &CounterMap, SourceManager &SM, const LangOptions &LangOpts) - : CoverageMappingBuilder(CVM, SM, LangOpts), CounterMap(CounterMap), - Builder(NumRegionCounters) {} + : CoverageMappingBuilder(CVM, SM, LangOpts), CounterMap(CounterMap) {} /// \brief Write the mapping data to the output stream void write(llvm::raw_ostream &OS) { @@ -1213,8 +1211,7 @@ unsigned CoverageMappingModuleGen::getFileID(const FileEntry *File) { void CoverageMappingGen::emitCounterMapping(const Decl *D, llvm::raw_ostream &OS) { assert(CounterMap); - CounterCoverageMappingBuilder Walker(CVM, *CounterMap, NumRegionCounters, SM, - LangOpts); + CounterCoverageMappingBuilder Walker(CVM, *CounterMap, SM, LangOpts); Walker.VisitDecl(D); Walker.write(OS); } diff --git a/lib/CodeGen/CoverageMappingGen.h b/lib/CodeGen/CoverageMappingGen.h index 45e0db8bce..e4c6412be0 100644 --- a/lib/CodeGen/CoverageMappingGen.h +++ b/lib/CodeGen/CoverageMappingGen.h @@ -87,20 +87,16 @@ class CoverageMappingGen { SourceManager &SM; const LangOptions &LangOpts; llvm::DenseMap *CounterMap; - unsigned NumRegionCounters; public: CoverageMappingGen(CoverageMappingModuleGen &CVM, SourceManager &SM, const LangOptions &LangOpts) - : CVM(CVM), SM(SM), LangOpts(LangOpts), CounterMap(nullptr), - NumRegionCounters(0) {} + : CVM(CVM), SM(SM), LangOpts(LangOpts), CounterMap(nullptr) {} CoverageMappingGen(CoverageMappingModuleGen &CVM, SourceManager &SM, const LangOptions &LangOpts, - llvm::DenseMap *CounterMap, - unsigned NumRegionCounters) - : CVM(CVM), SM(SM), LangOpts(LangOpts), CounterMap(CounterMap), - NumRegionCounters(NumRegionCounters) {} + llvm::DenseMap *CounterMap) + : CVM(CVM), SM(SM), LangOpts(LangOpts), CounterMap(CounterMap) {} /// \brief Emit the coverage mapping data which maps the regions of /// code to counters that will be used to find the execution -- 2.40.0