diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2016-05-14 04:58:38 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-05-14 04:58:38 +0000 |
commit | 2a16a5fae578ffd07a17ea6889d96bc8b9587670 (patch) | |
tree | a5f6ee4955a5bef66fc70829d63d47b355681e3c | |
parent | db8dd5515de1061a688d35ca53087a61541a7eee (diff) | |
download | bcm5719-llvm-2a16a5fae578ffd07a17ea6889d96bc8b9587670.tar.gz bcm5719-llvm-2a16a5fae578ffd07a17ea6889d96bc8b9587670.zip |
ThinLTOCodeGenerator: handle std::error_code instead of silently dropping it.
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 269541
-rw-r--r-- | llvm/lib/LTO/ThinLTOCodeGenerator.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp index 93a3f3e84ad..b57166d65ab 100644 --- a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp +++ b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp @@ -502,7 +502,11 @@ public: OS << OutputBuffer.getBuffer(); } // Rename to final destination (hopefully race condition won't matter here) - sys::fs::rename(TempFilename, EntryPath); + EC = sys::fs::rename(TempFilename, EntryPath); + if (EC) { + errs() << "Error: " << EC.message() << "\n"; + report_fatal_error("ThinLTO: Can't rename temporary file " + TempFilename + " to " + EntryPath); + } } }; |