Author: pcc Date: Thu May 31 11:25:59 2018 New Revision: 333677 URL: http://llvm.org/viewvc/llvm-project?rev=333677&view=rev Log: IRGen: Write .dwo files when -split-dwarf-file is used together with -fthinlto-index.
Differential Revision: https://reviews.llvm.org/D47597 Added: cfe/trunk/test/CodeGen/thinlto-split-dwarf.c Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=333677&r1=333676&r2=333677&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original) +++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Thu May 31 11:25:59 2018 @@ -1161,6 +1161,7 @@ static void runThinLTOBackend(ModuleSumm Conf.DebugPassManager = CGOpts.DebugPassManager; Conf.RemarksWithHotness = CGOpts.DiagnosticsWithHotness; Conf.RemarksFilename = CGOpts.OptRecordFile; + Conf.DwoPath = CGOpts.SplitDwarfFile; switch (Action) { case Backend_EmitNothing: Conf.PreCodeGenModuleHook = [](size_t Task, const Module &Mod) { Added: cfe/trunk/test/CodeGen/thinlto-split-dwarf.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/thinlto-split-dwarf.c?rev=333677&view=auto ============================================================================== --- cfe/trunk/test/CodeGen/thinlto-split-dwarf.c (added) +++ cfe/trunk/test/CodeGen/thinlto-split-dwarf.c Thu May 31 11:25:59 2018 @@ -0,0 +1,21 @@ +// REQUIRES: x86-registered-target + +// RUN: %clang_cc1 -debug-info-kind=limited -triple x86_64-unknown-linux-gnu \ +// RUN: -flto=thin -emit-llvm-bc \ +// RUN: -o %t.o %s + +// RUN: llvm-lto2 run -thinlto-distributed-indexes %t.o \ +// RUN: -o %t2.index \ +// RUN: -r=%t.o,main,px + +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu \ +// RUN: -emit-obj -fthinlto-index=%t.o.thinlto.bc \ +// RUN: -o %t.native.o -split-dwarf-file %t.native.dwo -x ir %t.o + +// RUN: llvm-readobj -sections %t.native.o | FileCheck --check-prefix=O %s +// RUN: llvm-readobj -sections %t.native.dwo | FileCheck --check-prefix=DWO %s + +// O-NOT: .dwo +// DWO: .dwo + +int main() {} _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits