r218882 - Revert "InstrProf: Update for the LLVM API change in r218879"
Justin Bogner
mail at justinbogner.com
Thu Oct 2 09:15:37 PDT 2014
Author: bogner
Date: Thu Oct 2 11:15:37 2014
New Revision: 218882
URL: http://llvm.org/viewvc/llvm-project?rev=218882&view=rev
Log:
Revert "InstrProf: Update for the LLVM API change in r218879"
r218879 has been reverted for now, this needs to go to match.
This reverts commit r218880.
Modified:
cfe/trunk/lib/CodeGen/CodeGenPGO.cpp
cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp
cfe/trunk/lib/CodeGen/CoverageMappingGen.h
Modified: cfe/trunk/lib/CodeGen/CodeGenPGO.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenPGO.cpp?rev=218882&r1=218881&r2=218882&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenPGO.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenPGO.cpp Thu Oct 2 11:15:37 2014
@@ -908,7 +908,8 @@ void CodeGenPGO::emitCounterRegionMappin
llvm::raw_string_ostream OS(CoverageMapping);
CoverageMappingGen MappingGen(*CGM.getCoverageMapping(),
CGM.getContext().getSourceManager(),
- CGM.getLangOpts(), RegionCounterMap.get());
+ CGM.getLangOpts(), RegionCounterMap.get(),
+ NumRegionCounters);
MappingGen.emitCounterMapping(D, OS);
OS.flush();
}
Modified: cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp?rev=218882&r1=218881&r2=218882&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp (original)
+++ cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp Thu Oct 2 11:15:37 2014
@@ -581,9 +581,11 @@ struct CounterCoverageMappingBuilder
CounterCoverageMappingBuilder(
CoverageMappingModuleGen &CVM,
- llvm::DenseMap<const Stmt *, unsigned> &CounterMap, SourceManager &SM,
+ llvm::DenseMap<const Stmt *, unsigned> &CounterMap,
+ unsigned NumRegionCounters, SourceManager &SM,
const LangOptions &LangOpts)
- : CoverageMappingBuilder(CVM, SM, LangOpts), CounterMap(CounterMap) {}
+ : CoverageMappingBuilder(CVM, SM, LangOpts), CounterMap(CounterMap),
+ Builder(NumRegionCounters) {}
/// \brief Write the mapping data to the output stream
void write(llvm::raw_ostream &OS) {
@@ -1211,7 +1213,8 @@ unsigned CoverageMappingModuleGen::getFi
void CoverageMappingGen::emitCounterMapping(const Decl *D,
llvm::raw_ostream &OS) {
assert(CounterMap);
- CounterCoverageMappingBuilder Walker(CVM, *CounterMap, SM, LangOpts);
+ CounterCoverageMappingBuilder Walker(CVM, *CounterMap, NumRegionCounters, SM,
+ LangOpts);
Walker.VisitDecl(D);
Walker.write(OS);
}
Modified: cfe/trunk/lib/CodeGen/CoverageMappingGen.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CoverageMappingGen.h?rev=218882&r1=218881&r2=218882&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CoverageMappingGen.h (original)
+++ cfe/trunk/lib/CodeGen/CoverageMappingGen.h Thu Oct 2 11:15:37 2014
@@ -87,16 +87,20 @@ class CoverageMappingGen {
SourceManager &SM;
const LangOptions &LangOpts;
llvm::DenseMap<const Stmt *, unsigned> *CounterMap;
+ unsigned NumRegionCounters;
public:
CoverageMappingGen(CoverageMappingModuleGen &CVM, SourceManager &SM,
const LangOptions &LangOpts)
- : CVM(CVM), SM(SM), LangOpts(LangOpts), CounterMap(nullptr) {}
+ : CVM(CVM), SM(SM), LangOpts(LangOpts), CounterMap(nullptr),
+ NumRegionCounters(0) {}
CoverageMappingGen(CoverageMappingModuleGen &CVM, SourceManager &SM,
const LangOptions &LangOpts,
- llvm::DenseMap<const Stmt *, unsigned> *CounterMap)
- : CVM(CVM), SM(SM), LangOpts(LangOpts), CounterMap(CounterMap) {}
+ llvm::DenseMap<const Stmt *, unsigned> *CounterMap,
+ unsigned NumRegionCounters)
+ : CVM(CVM), SM(SM), LangOpts(LangOpts), CounterMap(CounterMap),
+ NumRegionCounters(NumRegionCounters) {}
/// \brief Emit the coverage mapping data which maps the regions of
/// code to counters that will be used to find the execution
More information about the cfe-commits
mailing list