summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2013-03-09 01:33:06 +0000
committerNick Lewycky <nicholas@mxc.ca>2013-03-09 01:33:06 +0000
commit88f1d0d64e4f8c165c78e3cddb5d5c90e9c66932 (patch)
treee101dc12ac08811bdf06bb11bd866f85650a65c9 /llvm/lib/Transforms
parent613f3c00228522fc7cf3f99181b8172accbcae0d (diff)
downloadbcm5719-llvm-88f1d0d64e4f8c165c78e3cddb5d5c90e9c66932.tar.gz
bcm5719-llvm-88f1d0d64e4f8c165c78e3cddb5d5c90e9c66932.zip
Don't emit the extra checksum into the .gcda file if the user hasn't asked for
it. Fortunately, versions of gcov that predate the extra checksum also ignore any extra data, so this isn't a problem. There will be a matching commit in compiler-rt. llvm-svn: 176745
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp b/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp
index db1dd412830..c448caa15ab 100644
--- a/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp
+++ b/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp
@@ -601,9 +601,10 @@ Constant *GCOVProfiler::getIncrementIndirectCounterFunc() {
}
Constant *GCOVProfiler::getEmitFunctionFunc() {
- Type *Args[2] = {
+ Type *Args[3] = {
Type::getInt32Ty(*Ctx), // uint32_t ident
Type::getInt8PtrTy(*Ctx), // const char *function_name
+ Type::getInt8Ty(*Ctx), // uint8_t use_extra_checksum
};
FunctionType *FTy = FunctionType::get(Type::getVoidTy(*Ctx), Args, false);
return M->getOrInsertFunction("llvm_gcda_emit_function", FTy);
@@ -668,12 +669,13 @@ void GCOVProfiler::insertCounterWriteout(
I = CountersBySP.begin(), E = CountersBySP.end();
I != E; ++I) {
DISubprogram SP(I->second);
- Builder.CreateCall2(EmitFunction,
+ Builder.CreateCall3(EmitFunction,
Builder.getInt32(i),
NoFunctionNamesInData ?
Constant::getNullValue(Builder.getInt8PtrTy()) :
- Builder.CreateGlobalStringPtr(SP.getName()));
-
+ Builder.CreateGlobalStringPtr(SP.getName()),
+ Builder.getInt8(UseExtraChecksum));
+
GlobalVariable *GV = I->first;
unsigned Arcs =
cast<ArrayType>(GV->getType()->getElementType())->getNumElements();
OpenPOWER on IntegriCloud