Skip to content

Commit e1cf849

Browse files
authored
[LLD][COFF] Use parentName for import files in toString. (#106104)
Improves diagnostic messages.
1 parent 178fc47 commit e1cf849

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

lld/COFF/InputFiles.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ static StringRef getBasename(StringRef path) {
6161
std::string lld::toString(const coff::InputFile *file) {
6262
if (!file)
6363
return "<internal>";
64-
if (file->parentName.empty() || file->kind() == coff::InputFile::ImportKind)
64+
if (file->parentName.empty())
6565
return std::string(file->getName());
6666

6767
return (getBasename(file->parentName) + "(" + getBasename(file->getName()) +

lld/test/COFF/delayimports-error.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# RUN: /alternatename:__delayLoadHelper2=main /opt:noref >& %t.log
99
# RUN: FileCheck %s < %t.log
1010

11-
# CHECK: cannot delay-load foo.dll due to import of data: __declspec(dllimport) datasym
11+
# CHECK: cannot delay-load foo.lib(foo.dll) due to import of data: __declspec(dllimport) datasym
1212

1313
--- !COFF
1414
header:

lld/test/COFF/duplicate.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ RUN: not lld-link /out:gamma.exe /subsystem:console /entry:mainCRTStartup gamma.
1313

1414
CHECK-GAMMA: error: duplicate symbol: __declspec(dllimport) f
1515
CHECK-GAMMA: defined at {{.*}}gamma.obj
16-
CHECK-GAMMA: defined at alpha.dll
16+
CHECK-GAMMA: defined at alpha.lib(alpha.dll)
1717

lld/test/COFF/implib-machine.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
# RUN: llvm-mc -triple x86_64-windows-msvc %t.dir/test.s -filetype=obj -o %t.dir/test64.obj
77

88
# RUN: not lld-link -dll -noentry -out:%t32.dll %t.dir/test32.obj %t.dir/test64.lib 2>&1 | FileCheck --check-prefix=ERR32 %s
9-
# ERR32: error: test.dll: machine type x64 conflicts with x86
9+
# ERR32: error: test64.lib(test.dll): machine type x64 conflicts with x86
1010

1111
# RUN: not lld-link -dll -noentry -out:%t64.dll %t.dir/test64.obj %t.dir/test32.lib 2>&1 | FileCheck --check-prefix=ERR64 %s
12-
# ERR64: error: test.dll: machine type x86 conflicts with x64
12+
# ERR64: error: test32.lib(test.dll): machine type x86 conflicts with x64
1313

1414
#--- test.s
1515
.def @feat.00;

0 commit comments

Comments
 (0)