diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2013-02-27 06:22:56 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2013-02-27 06:22:56 +0000 |
commit | 52b4edf6a1b5d3a9f8a94a63c702d55ed446ecdb (patch) | |
tree | 99127260c735702a1a751e7217cbe74cd180d794 /lib/Transforms/Instrumentation/GCOVProfiling.cpp | |
parent | 58591b1647e0f1f213e5acd7bfa87c226ced0033 (diff) |
In GCC 4.7, function names are now forbidden from .gcda files. Support this by
passing a null pointer to the function name in to GCDAProfiling, and add another
switch onto GCOVProfiling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176173 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Instrumentation/GCOVProfiling.cpp')
-rw-r--r-- | lib/Transforms/Instrumentation/GCOVProfiling.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/lib/Transforms/Instrumentation/GCOVProfiling.cpp b/lib/Transforms/Instrumentation/GCOVProfiling.cpp index 09dea48e39..095b852d93 100644 --- a/lib/Transforms/Instrumentation/GCOVProfiling.cpp +++ b/lib/Transforms/Instrumentation/GCOVProfiling.cpp @@ -45,14 +45,16 @@ namespace { static char ID; GCOVProfiler() : ModulePass(ID), EmitNotes(true), EmitData(true), Use402Format(false), - UseExtraChecksum(false), NoRedZone(false) { + UseExtraChecksum(false), NoRedZone(false), + NoFunctionNamesInData(false) { initializeGCOVProfilerPass(*PassRegistry::getPassRegistry()); } - GCOVProfiler(bool EmitNotes, bool EmitData, bool use402Format, - bool useExtraChecksum, bool NoRedZone_) + GCOVProfiler(bool EmitNotes, bool EmitData, bool Use402Format, + bool UseExtraChecksum, bool NoRedZone, + bool NoFunctionNamesInData) : ModulePass(ID), EmitNotes(EmitNotes), EmitData(EmitData), - Use402Format(use402Format), UseExtraChecksum(useExtraChecksum), - NoRedZone(NoRedZone_) { + Use402Format(Use402Format), UseExtraChecksum(UseExtraChecksum), + NoRedZone(NoRedZone), NoFunctionNamesInData(NoFunctionNamesInData) { assert((EmitNotes || EmitData) && "GCOVProfiler asked to do nothing?"); initializeGCOVProfilerPass(*PassRegistry::getPassRegistry()); } @@ -100,6 +102,7 @@ namespace { bool Use402Format; bool UseExtraChecksum; bool NoRedZone; + bool NoFunctionNamesInData; Module *M; LLVMContext *Ctx; @@ -113,9 +116,10 @@ INITIALIZE_PASS(GCOVProfiler, "insert-gcov-profiling", ModulePass *llvm::createGCOVProfilerPass(bool EmitNotes, bool EmitData, bool Use402Format, bool UseExtraChecksum, - bool NoRedZone) { + bool NoRedZone, + bool NoFunctionNamesInData) { return new GCOVProfiler(EmitNotes, EmitData, Use402Format, UseExtraChecksum, - NoRedZone); + NoRedZone, NoFunctionNamesInData); } namespace { @@ -664,7 +668,9 @@ void GCOVProfiler::insertCounterWriteout( intptr_t ident = reinterpret_cast<intptr_t>(I->second); Builder.CreateCall2(EmitFunction, Builder.getInt32(ident), - Builder.CreateGlobalStringPtr(SP.getName())); + NoFunctionNamesInData ? + Constant::getNullValue(Builder.getInt8PtrTy()) : + Builder.CreateGlobalStringPtr(SP.getName())); GlobalVariable *GV = I->first; unsigned Arcs = |