[PATCH] D152360: [llvm-dlltool] Clarify parameters, simplify ArgList usage. NFC.
Martin Storsjö via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 7 04:39:27 PDT 2023
mstorsjo created this revision.
mstorsjo added reviewers: alvinhochun, mati865, jeremyd2019.
Herald added subscribers: ormris, steven_wu, hiraditya, inglorion.
Herald added a project: All.
mstorsjo requested review of this revision.
Herald added a project: LLVM.
Add comments about unclear bool arguments to functions, switch to
hasArg instead of getLastArg for cases where we don't need to check
the argument's value.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D152360
Files:
llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp
Index: llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp
===================================================================
--- llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp
+++ llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp
@@ -166,7 +166,7 @@
}
Expected<COFFModuleDefinition> Def =
- parseCOFFModuleDefinition(*MB, Machine, true);
+ parseCOFFModuleDefinition(*MB, Machine, /*MingwDef=*/true);
if (!Def) {
llvm::errs() << "error parsing definition\n"
@@ -197,7 +197,7 @@
}
}
- if (Machine == IMAGE_FILE_MACHINE_I386 && Args.getLastArg(OPT_k)) {
+ if (Machine == IMAGE_FILE_MACHINE_I386 && Args.hasArg(OPT_k)) {
for (COFFShortExport& E : Def->Exports) {
if (!E.AliasTarget.empty() || (!E.Name.empty() && E.Name[0] == '?'))
continue;
@@ -214,8 +214,8 @@
}
}
- if (!Path.empty() &&
- writeImportLibrary(Def->OutputFile, Path, Def->Exports, Machine, true))
+ if (!Path.empty() && writeImportLibrary(Def->OutputFile, Path, Def->Exports,
+ Machine, /*MinGW=*/true))
return 1;
return 0;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152360.529250.patch
Type: text/x-patch
Size: 1125 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230607/445b6b34/attachment.bin>
More information about the llvm-commits
mailing list