From 17d2f776011cba33f7f5afb03c8066d35dbf8afc Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Sat, 9 Mar 2013 01:33:06 +0000 Subject: 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176745 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Instrumentation/GCOVProfiling.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/Transforms/Instrumentation/GCOVProfiling.cpp') diff --git a/lib/Transforms/Instrumentation/GCOVProfiling.cpp b/lib/Transforms/Instrumentation/GCOVProfiling.cpp index db1dd41283..c448caa15a 100644 --- a/lib/Transforms/Instrumentation/GCOVProfiling.cpp +++ b/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(GV->getType()->getElementType())->getNumElements(); -- cgit v1.2.3