diff options
author | Adrian Prantl <aprantl@apple.com> | 2016-04-08 22:43:06 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2016-04-08 22:43:06 +0000 |
commit | 826824ea3db9ef2659b5da73141f5f37e4dad783 (patch) | |
tree | 154bb777bf774c43ebba70690e84af9c2ae8eeb0 /clang/lib/CodeGen/CGDebugInfo.cpp | |
parent | 5992a72b4d21f3ea15a0ecbb593d92c9bc4fe1a0 (diff) | |
download | bcm5719-llvm-826824ea3db9ef2659b5da73141f5f37e4dad783.tar.gz bcm5719-llvm-826824ea3db9ef2659b5da73141f5f37e4dad783.zip |
Use NoDebug compile units to mark debug metadata used only for sample-based
profiling and optimization remarks and indicate that no debug info shall
be emitted for these compile units.
http://reviews.llvm.org/D18808
<rdar://problem/25427165>
llvm-svn: 265862
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 7fc41d59377..ee013a0b9be 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -396,16 +396,27 @@ void CGDebugInfo::CreateCompileUnit() { if (LO.ObjC1) RuntimeVers = LO.ObjCRuntime.isNonFragile() ? 2 : 1; + llvm::DICompileUnit::DebugEmissionKind EmissionKind; + switch (DebugKind) { + case codegenoptions::NoDebugInfo: + case codegenoptions::LocTrackingOnly: + EmissionKind = llvm::DICompileUnit::NoDebug; + break; + case codegenoptions::DebugLineTablesOnly: + EmissionKind = llvm::DICompileUnit::LineTablesOnly; + break; + case codegenoptions::LimitedDebugInfo: + case codegenoptions::FullDebugInfo: + EmissionKind = llvm::DICompileUnit::FullDebug; + break; + } + // Create new compile unit. // FIXME - Eliminate TheCU. TheCU = DBuilder.createCompileUnit( LangTag, remapDIPath(MainFileName), remapDIPath(getCurrentDirname()), Producer, LO.Optimize, CGM.getCodeGenOpts().DwarfDebugFlags, RuntimeVers, - CGM.getCodeGenOpts().SplitDwarfFile, - DebugKind <= codegenoptions::DebugLineTablesOnly - ? llvm::DICompileUnit::LineTablesOnly - : llvm::DICompileUnit::FullDebug, - 0 /* DWOid */, DebugKind != codegenoptions::LocTrackingOnly); + CGM.getCodeGenOpts().SplitDwarfFile, EmissionKind, 0 /* DWOid */); } llvm::DIType *CGDebugInfo::CreateType(const BuiltinType *BT) { |