aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
diff options
context:
space:
mode:
authorJacek Caban <jacek@codeweavers.com>2024-11-15 16:14:37 +0100
committerGitHub <noreply@github.com>2024-11-15 16:14:37 +0100
commita9d94834cd91fe93d8723ac4232fe7becdca61a7 (patch)
tree4e48ce5935e8f6cbb01d6d7500338bb1548049cd /llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
parent0fb8fac5d6c10610574e6e472670823eaff0c949 (diff)
downloadllvm-a9d94834cd91fe93d8723ac4232fe7becdca61a7.zip
llvm-a9d94834cd91fe93d8723ac4232fe7becdca61a7.tar.gz
llvm-a9d94834cd91fe93d8723ac4232fe7becdca61a7.tar.bz2
[llvm-lib][llvm-dlltool] Fix handling of invalid ARM64EC function names (#116250)
This is a follow-up to #115567. Emit an error for invalid function names, similar to MSVC's `lib.exe` behavior. Returning an error from `writeImportLibrary` exposed bugs in error handling by its callers, which have been addressed in this patch.
Diffstat (limited to 'llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp')
-rw-r--r--llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp b/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
index 07389a5..2e0841b 100644
--- a/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
+++ b/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
@@ -419,10 +419,15 @@ int llvm::libDriverMain(ArrayRef<const char *> ArgsArr) {
OutputFile = std::move(NativeDef->OutputFile);
}
- return writeImportLibrary(OutputFile, OutputPath, Def->Exports, LibMachine,
- /*MinGW=*/false, NativeExports)
- ? 1
- : 0;
+ if (Error E =
+ writeImportLibrary(OutputFile, OutputPath, Def->Exports, LibMachine,
+ /*MinGW=*/false, NativeExports)) {
+ handleAllErrors(std::move(E), [&](const ErrorInfoBase &EI) {
+ llvm::errs() << OutputPath << ": " << EI.message() << "\n";
+ });
+ return 1;
+ }
+ return 0;
}
// If no input files and not told otherwise, silently do nothing to match