[llvm] r195311 - llvm-cov: Don't assume FileChecksum was generated.
Yuchen Wu
yuchenericwu at hotmail.com
Wed Nov 20 20:53:39 PST 2013
Author: ywu
Date: Wed Nov 20 22:53:39 2013
New Revision: 195311
URL: http://llvm.org/viewvc/llvm-project?rev=195311&view=rev
Log:
llvm-cov: Don't assume FileChecksum was generated.
For cases where emitProfileArcs() was called but emitProfileNotes() was
not, set the CfgChecksum to 0.
Modified:
llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp
Modified: llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp?rev=195311&r1=195310&r2=195311&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp Wed Nov 20 22:53:39 2013
@@ -803,10 +803,11 @@ Function *GCOVProfiler::insertCounterWri
for (unsigned i = 0, e = CU_Nodes->getNumOperands(); i != e; ++i) {
DICompileUnit CU(CU_Nodes->getOperand(i));
std::string FilenameGcda = mangleName(CU, "gcda");
+ uint32_t CfgChecksum = FileChecksums.size() ? FileChecksums[i] : 0;
Builder.CreateCall3(StartFile,
Builder.CreateGlobalStringPtr(FilenameGcda),
Builder.CreateGlobalStringPtr(ReversedVersion),
- Builder.getInt32(FileChecksums[i]));
+ Builder.getInt32(CfgChecksum));
for (unsigned j = 0, e = CountersBySP.size(); j != e; ++j) {
DISubprogram SP(CountersBySP[j].second);
Builder.CreateCall4(
@@ -815,7 +816,7 @@ Function *GCOVProfiler::insertCounterWri
Builder.CreateGlobalStringPtr(getFunctionName(SP)) :
Constant::getNullValue(Builder.getInt8PtrTy()),
Builder.getInt8(Options.UseCfgChecksum),
- Builder.getInt32(FileChecksums[i]));
+ Builder.getInt32(CfgChecksum));
GlobalVariable *GV = CountersBySP[j].first;
unsigned Arcs =
More information about the llvm-commits
mailing list