[lld] [LLD][COFF] Use parentName for import files in toString. (PR #106104)
Jacek Caban via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 26 10:02:32 PDT 2024
https://github.com/cjacek created https://github.com/llvm/llvm-project/pull/106104
None
>From d43606dd9e3af5b688a537e116d921cdad844e84 Mon Sep 17 00:00:00 2001
From: Jacek Caban <jacek at codeweavers.com>
Date: Mon, 26 Aug 2024 18:07:36 +0200
Subject: [PATCH] [LLD][COFF] Use parentName for import files in toString.
---
lld/COFF/InputFiles.cpp | 2 +-
lld/test/COFF/delayimports-error.test | 2 +-
lld/test/COFF/duplicate.test | 2 +-
lld/test/COFF/implib-machine.s | 4 ++--
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/lld/COFF/InputFiles.cpp b/lld/COFF/InputFiles.cpp
index f9a22b0a7a5f0f..3ecd4d241f2cd4 100644
--- a/lld/COFF/InputFiles.cpp
+++ b/lld/COFF/InputFiles.cpp
@@ -61,7 +61,7 @@ static StringRef getBasename(StringRef path) {
std::string lld::toString(const coff::InputFile *file) {
if (!file)
return "<internal>";
- if (file->parentName.empty() || file->kind() == coff::InputFile::ImportKind)
+ if (file->parentName.empty())
return std::string(file->getName());
return (getBasename(file->parentName) + "(" + getBasename(file->getName()) +
diff --git a/lld/test/COFF/delayimports-error.test b/lld/test/COFF/delayimports-error.test
index cced9fb65e6142..5f45083cf5e613 100644
--- a/lld/test/COFF/delayimports-error.test
+++ b/lld/test/COFF/delayimports-error.test
@@ -8,7 +8,7 @@
# RUN: /alternatename:__delayLoadHelper2=main /opt:noref >& %t.log
# RUN: FileCheck %s < %t.log
-# CHECK: cannot delay-load foo.dll due to import of data: __declspec(dllimport) datasym
+# CHECK: cannot delay-load foo.lib(foo.dll) due to import of data: __declspec(dllimport) datasym
--- !COFF
header:
diff --git a/lld/test/COFF/duplicate.test b/lld/test/COFF/duplicate.test
index 76c88b070ff375..11e5aa06318fe0 100644
--- a/lld/test/COFF/duplicate.test
+++ b/lld/test/COFF/duplicate.test
@@ -13,5 +13,5 @@ RUN: not lld-link /out:gamma.exe /subsystem:console /entry:mainCRTStartup gamma.
CHECK-GAMMA: error: duplicate symbol: __declspec(dllimport) f
CHECK-GAMMA: defined at {{.*}}gamma.obj
-CHECK-GAMMA: defined at alpha.dll
+CHECK-GAMMA: defined at alpha.lib(alpha.dll)
diff --git a/lld/test/COFF/implib-machine.s b/lld/test/COFF/implib-machine.s
index 32deff0fc25f89..92f01bbc72799b 100644
--- a/lld/test/COFF/implib-machine.s
+++ b/lld/test/COFF/implib-machine.s
@@ -6,10 +6,10 @@
# RUN: llvm-mc -triple x86_64-windows-msvc %t.dir/test.s -filetype=obj -o %t.dir/test64.obj
# RUN: not lld-link -dll -noentry -out:%t32.dll %t.dir/test32.obj %t.dir/test64.lib 2>&1 | FileCheck --check-prefix=ERR32 %s
-# ERR32: error: test.dll: machine type x64 conflicts with x86
+# ERR32: error: test64.lib(test.dll): machine type x64 conflicts with x86
# RUN: not lld-link -dll -noentry -out:%t64.dll %t.dir/test64.obj %t.dir/test32.lib 2>&1 | FileCheck --check-prefix=ERR64 %s
-# ERR64: error: test.dll: machine type x86 conflicts with x64
+# ERR64: error: test32.lib(test.dll): machine type x86 conflicts with x64
#--- test.s
.def @feat.00;
More information about the llvm-commits
mailing list