Skip to content

Commit 4078226

Browse files
committed
[llvm-dlltool] Remove support for implying output name
I don't see GNU dlltool supporting doing this; with only a -d option and no -l option, GNU dlltool runs successfully but doesn't write any output file. Differential Revision: https://reviews.llvm.org/D65645 llvm-svn: 370655
1 parent a66fc1c commit 4078226

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,6 @@ static MachineTypes getEmulation(StringRef S) {
7474
.Default(IMAGE_FILE_MACHINE_UNKNOWN);
7575
}
7676

77-
static std::string getImplibPath(StringRef Path) {
78-
SmallString<128> Out = StringRef("lib");
79-
Out.append(Path);
80-
sys::path::replace_extension(Out, ".a");
81-
return Out.str();
82-
}
83-
8477
int llvm::dlltoolDriverMain(llvm::ArrayRef<const char *> ArgsArr) {
8578
DllOptTable Table;
8679
unsigned MissingIndex;
@@ -154,8 +147,6 @@ int llvm::dlltoolDriverMain(llvm::ArrayRef<const char *> ArgsArr) {
154147
}
155148

156149
std::string Path = Args.getLastArgValue(OPT_l);
157-
if (Path.empty())
158-
Path = getImplibPath(Def->OutputFile);
159150

160151
if (Machine == IMAGE_FILE_MACHINE_I386 && Args.getLastArg(OPT_k)) {
161152
for (COFFShortExport& E : Def->Exports) {
@@ -175,7 +166,8 @@ int llvm::dlltoolDriverMain(llvm::ArrayRef<const char *> ArgsArr) {
175166
}
176167
}
177168

178-
if (writeImportLibrary(Def->OutputFile, Path, Def->Exports, Machine, true))
169+
if (!Path.empty() &&
170+
writeImportLibrary(Def->OutputFile, Path, Def->Exports, Machine, true))
179171
return 1;
180172
return 0;
181173
}

0 commit comments

Comments
 (0)