summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2013-02-27 06:22:56 +0000
committerNick Lewycky <nicholas@mxc.ca>2013-02-27 06:22:56 +0000
commit6fd43e40716775dd3ccfb646e48c719082c74ffb (patch)
tree6c05a8af27a29efdaff800811937f51729746548 /llvm/lib/Transforms
parent625f3956632dfa940b08afe562fb4a9f732bf7fa (diff)
downloadbcm5719-llvm-6fd43e40716775dd3ccfb646e48c719082c74ffb.tar.gz
bcm5719-llvm-6fd43e40716775dd3ccfb646e48c719082c74ffb.zip
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. llvm-svn: 176173
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp b/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp
index 09dea48e398..095b852d938 100644
--- a/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp
+++ b/llvm/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 =
OpenPOWER on IntegriCloud