summaryrefslogtreecommitdiffstats
path: root/llvm/lib/LTO/LTOBackend.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2018-05-31 18:25:59 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2018-05-31 18:25:59 +0000
commit3aa30e8062a104d5b17d389bd26461bef2aa6fa8 (patch)
tree6b133bc5348ea458cbebd989b46475cded178988 /llvm/lib/LTO/LTOBackend.cpp
parentd10c4e07f50fefd90342ee78e4ce85a32aa61200 (diff)
downloadbcm5719-llvm-3aa30e8062a104d5b17d389bd26461bef2aa6fa8.tar.gz
bcm5719-llvm-3aa30e8062a104d5b17d389bd26461bef2aa6fa8.zip
IRGen: Write .dwo files when -split-dwarf-file is used together with -fthinlto-index.
Differential Revision: https://reviews.llvm.org/D47597 llvm-svn: 333677
Diffstat (limited to 'llvm/lib/LTO/LTOBackend.cpp')
-rw-r--r--llvm/lib/LTO/LTOBackend.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/LTO/LTOBackend.cpp b/llvm/lib/LTO/LTOBackend.cpp
index 0061bc94d2c..0ead3989941 100644
--- a/llvm/lib/LTO/LTOBackend.cpp
+++ b/llvm/lib/LTO/LTOBackend.cpp
@@ -291,14 +291,19 @@ void codegen(Config &Conf, TargetMachine *TM, AddStreamFn AddStream,
return;
std::unique_ptr<ToolOutputFile> DwoOut;
+ SmallString<1024> DwoFile(Conf.DwoPath);
if (!Conf.DwoDir.empty()) {
std::error_code EC;
if (auto EC = llvm::sys::fs::create_directories(Conf.DwoDir))
report_fatal_error("Failed to create directory " + Conf.DwoDir + ": " +
EC.message());
- SmallString<1024> DwoFile(Conf.DwoDir);
+ DwoFile = Conf.DwoDir;
sys::path::append(DwoFile, std::to_string(Task) + ".dwo");
+ }
+
+ if (!DwoFile.empty()) {
+ std::error_code EC;
TM->Options.MCOptions.SplitDwarfFile = DwoFile.str().str();
DwoOut = llvm::make_unique<ToolOutputFile>(DwoFile, EC, sys::fs::F_None);
if (EC)
OpenPOWER on IntegriCloud