diff options
| author | Davide Italiano <davide@freebsd.org> | 2016-03-20 20:12:33 +0000 |
|---|---|---|
| committer | Davide Italiano <davide@freebsd.org> | 2016-03-20 20:12:33 +0000 |
| commit | 289a43ed0aeb921cda105468d7234e633acf04d2 (patch) | |
| tree | 40f3a99683d2eba3764e7f5ea499fe627563502e | |
| parent | fcfa38cf764269cd2853a8f670eff3b1335a6b16 (diff) | |
| download | bcm5719-llvm-289a43ed0aeb921cda105468d7234e633acf04d2.tar.gz bcm5719-llvm-289a43ed0aeb921cda105468d7234e633acf04d2.zip | |
[gold] Emit a diagnostic in case we fail to remove a file.
llvm-svn: 263914
| -rw-r--r-- | llvm/tools/gold/gold-plugin.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp index 57026f8d0ef..b70c072f9bf 100644 --- a/llvm/tools/gold/gold-plugin.cpp +++ b/llvm/tools/gold/gold-plugin.cpp @@ -1289,10 +1289,14 @@ static ld_plugin_status all_symbols_read_hook(void) { if (options::TheOutputType == options::OT_BC_ONLY || options::TheOutputType == options::OT_DISABLE) { - if (options::TheOutputType == options::OT_DISABLE) + if (options::TheOutputType == options::OT_DISABLE) { // Remove the output file here since ld.bfd creates the output file // early. - sys::fs::remove(output_name); + std::error_code EC = sys::fs::remove(output_name); + if (EC) + message(LDPL_ERROR, "Failed to delete '%s': %s", output_name.c_str(), + EC.message().c_str()); + } exit(0); } |

