[llvm] r176745 - Don't emit the extra checksum into the .gcda file if the user hasn't asked for

Nick Lewycky nicholas at mxc.ca
Fri Mar 8 17:33:06 PST 2013


Author: nicholas
Date: Fri Mar  8 19:33:06 2013
New Revision: 176745

URL: http://llvm.org/viewvc/llvm-project?rev=176745&view=rev
Log:
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.

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=176745&r1=176744&r2=176745&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp Fri Mar  8 19:33:06 2013
@@ -601,9 +601,10 @@ Constant *GCOVProfiler::getIncrementIndi
 }
 
 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();





More information about the llvm-commits mailing list