summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/DIBuilder.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2016-04-08 22:43:03 +0000
committerAdrian Prantl <aprantl@apple.com>2016-04-08 22:43:03 +0000
commit5992a72b4d21f3ea15a0ecbb593d92c9bc4fe1a0 (patch)
treee369ac2ee392142837ebf0b460286e0fe2bdda0a /llvm/lib/IR/DIBuilder.cpp
parentb24f4fb6171eaf2caa8f3cf6adcf11821ec1d27c (diff)
downloadbcm5719-llvm-5992a72b4d21f3ea15a0ecbb593d92c9bc4fe1a0.tar.gz
bcm5719-llvm-5992a72b4d21f3ea15a0ecbb593d92c9bc4fe1a0.zip
Support the Nodebug emission kind for DICompileUnits.
Sample-based profiling and optimization remarks currently remove DICompileUnits from llvm.dbg.cu to suppress the emission of debug info from them. This is somewhat of a hack and only borderline legal IR. This patch uses the recently introduced NoDebug emission kind in DICompileUnit to achieve the same result without breaking the Verifier. A nice side-effect of this change is that it is now possible to combine NoDebug and regular compile units under LTO. http://reviews.llvm.org/D18808 <rdar://problem/25427165> llvm-svn: 265861
Diffstat (limited to 'llvm/lib/IR/DIBuilder.cpp')
-rw-r--r--llvm/lib/IR/DIBuilder.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp
index fa4b860a58a..aa9ffcf9f3c 100644
--- a/llvm/lib/IR/DIBuilder.cpp
+++ b/llvm/lib/IR/DIBuilder.cpp
@@ -137,7 +137,7 @@ static DIScope *getNonCompileUnitScope(DIScope *N) {
DICompileUnit *DIBuilder::createCompileUnit(
unsigned Lang, StringRef Filename, StringRef Directory, StringRef Producer,
bool isOptimized, StringRef Flags, unsigned RunTimeVer, StringRef SplitName,
- DICompileUnit::DebugEmissionKind Kind, uint64_t DWOId, bool EmitDebugInfo) {
+ DICompileUnit::DebugEmissionKind Kind, uint64_t DWOId) {
assert(((Lang <= dwarf::DW_LANG_Fortran08 && Lang >= dwarf::DW_LANG_C89) ||
(Lang <= dwarf::DW_LANG_hi_user && Lang >= dwarf::DW_LANG_lo_user)) &&
@@ -152,15 +152,8 @@ DICompileUnit *DIBuilder::createCompileUnit(
nullptr, nullptr, nullptr, nullptr, nullptr, DWOId);
// Create a named metadata so that it is easier to find cu in a module.
- // Note that we only generate this when the caller wants to actually
- // emit debug information. When we are only interested in tracking
- // source line locations throughout the backend, we prevent codegen from
- // emitting debug info in the final output by not generating llvm.dbg.cu.
- if (EmitDebugInfo) {
- NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.cu");
- NMD->addOperand(CUNode);
- }
-
+ NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.cu");
+ NMD->addOperand(CUNode);
trackIfUnresolved(CUNode);
return CUNode;
}
OpenPOWER on IntegriCloud