summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-04-21 23:44:07 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-04-21 23:44:07 +0000
commit207bce31e15e63ebc5fcde0f7d2f8db0a99a89a2 (patch)
tree67fd0c79fd80cc3291be876dcdb13d8bb6eca39d /clang/lib/CodeGen/CodeGenModule.cpp
parent6aea59268a51d2fb2cc7bdc47f9e65e343aeb2a1 (diff)
downloadbcm5719-llvm-207bce31e15e63ebc5fcde0f7d2f8db0a99a89a2.tar.gz
bcm5719-llvm-207bce31e15e63ebc5fcde0f7d2f8db0a99a89a2.zip
Wire up the -ftest-coverage and -fprofile-arcs flags to .gcno file emission (at
compile time) and .gcda emission (at runtime). --coverage enables both. This does not yet add the profile_rt library to the link step if -fprofile-arcs is enabled when linking. llvm-svn: 129956
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 603e8c196b3..e73a0cffdb1 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -64,7 +64,7 @@ CodeGenModule::CodeGenModule(ASTContext &C, const CodeGenOptions &CGO,
ABI(createCXXABI(*this)),
Types(C, M, TD, getTargetCodeGenInfo().getABIInfo(), ABI),
TBAA(0),
- VTables(*this), Runtime(0),
+ VTables(*this), Runtime(0), DebugInfo(0),
CFConstantStringClassRef(0), ConstantStringClassRef(0),
VMContext(M.getContext()),
NSConcreteGlobalBlockDecl(0), NSConcreteStackBlockDecl(0),
@@ -80,8 +80,11 @@ CodeGenModule::CodeGenModule(ASTContext &C, const CodeGenOptions &CGO,
TBAA = new CodeGenTBAA(Context, VMContext, getLangOptions(),
ABI.getMangleContext());
- // If debug info generation is enabled, create the CGDebugInfo object.
- DebugInfo = CodeGenOpts.DebugInfo ? new CGDebugInfo(*this) : 0;
+ // If debug info or coverage generation is enabled, create the CGDebugInfo
+ // object.
+ if (CodeGenOpts.DebugInfo || CodeGenOpts.EmitGcovArcs ||
+ CodeGenOpts.EmitGcovNotes)
+ DebugInfo = new CGDebugInfo(*this);
Block.GlobalUniqueCount = 0;
OpenPOWER on IntegriCloud