mirror of https://github.com/microsoft/clang.git
Debug Info: Set the DICompileUnit's isOptimized flag when compiling with LTO.
rdar://problem/27640939 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310147 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9ceccf9787
commit
e6ae7627de
|
@ -527,16 +527,15 @@ void CGDebugInfo::CreateCompileUnit() {
|
||||||
|
|
||||||
// Create new compile unit.
|
// Create new compile unit.
|
||||||
// FIXME - Eliminate TheCU.
|
// FIXME - Eliminate TheCU.
|
||||||
|
auto &CGOpts = CGM.getCodeGenOpts();
|
||||||
TheCU = DBuilder.createCompileUnit(
|
TheCU = DBuilder.createCompileUnit(
|
||||||
LangTag,
|
LangTag,
|
||||||
DBuilder.createFile(remapDIPath(MainFileName),
|
DBuilder.createFile(remapDIPath(MainFileName),
|
||||||
remapDIPath(getCurrentDirname()), CSKind, Checksum),
|
remapDIPath(getCurrentDirname()), CSKind, Checksum),
|
||||||
Producer, LO.Optimize, CGM.getCodeGenOpts().DwarfDebugFlags, RuntimeVers,
|
Producer, LO.Optimize || CGOpts.PrepareForLTO || CGOpts.EmitSummaryIndex,
|
||||||
CGM.getCodeGenOpts().EnableSplitDwarf
|
CGOpts.DwarfDebugFlags, RuntimeVers,
|
||||||
? ""
|
CGOpts.EnableSplitDwarf ? "" : CGOpts.SplitDwarfFile, EmissionKind,
|
||||||
: CGM.getCodeGenOpts().SplitDwarfFile,
|
0 /* DWOid */, CGOpts.SplitDwarfInlining, CGOpts.DebugInfoForProfiling);
|
||||||
EmissionKind, 0 /* DWOid */, CGM.getCodeGenOpts().SplitDwarfInlining,
|
|
||||||
CGM.getCodeGenOpts().DebugInfoForProfiling);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
llvm::DIType *CGDebugInfo::CreateType(const BuiltinType *BT) {
|
llvm::DIType *CGDebugInfo::CreateType(const BuiltinType *BT) {
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
// RUN: %clang_cc1 -flto -emit-llvm -debug-info-kind=standalone %s -o - | FileCheck %s
|
||||||
|
// RUN: %clang_cc1 -flto=thin -emit-llvm -debug-info-kind=standalone %s -o - | FileCheck %s
|
||||||
|
// The "o" in LTO stands for optimization!
|
||||||
|
// CHECK: !DICompileUnit({{.*}} isOptimized: true
|
Loading…
Reference in New Issue