[llvm] 8deeaef - [llvm-dlltool] Clarify parameters, simplify ArgList usage. NFC.
Martin Storsjö via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 8 13:22:30 PDT 2023
Author: Martin Storsjö
Date: 2023-06-08T23:21:56+03:00
New Revision: 8deeaef0291f3d63900eb3c61dc46625fb24aafb
URL: https://github.com/llvm/llvm-project/commit/8deeaef0291f3d63900eb3c61dc46625fb24aafb
DIFF: https://github.com/llvm/llvm-project/commit/8deeaef0291f3d63900eb3c61dc46625fb24aafb.diff
LOG: [llvm-dlltool] Clarify parameters, simplify ArgList usage. NFC.
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.
Differential Revision: https://reviews.llvm.org/D152360
Added:
Modified:
llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp
Removed:
################################################################################
diff --git a/llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp b/llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp
index fcda61dd100f1..a5dcf6c1c45e1 100644
--- a/llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp
+++ b/llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp
@@ -166,7 +166,7 @@ int llvm::dlltoolDriverMain(llvm::ArrayRef<const char *> ArgsArr) {
}
Expected<COFFModuleDefinition> Def =
- parseCOFFModuleDefinition(*MB, Machine, true);
+ parseCOFFModuleDefinition(*MB, Machine, /*MingwDef=*/true);
if (!Def) {
llvm::errs() << "error parsing definition\n"
@@ -197,7 +197,7 @@ int llvm::dlltoolDriverMain(llvm::ArrayRef<const char *> ArgsArr) {
}
}
- 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 @@ int llvm::dlltoolDriverMain(llvm::ArrayRef<const char *> ArgsArr) {
}
}
- 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;
}
More information about the llvm-commits
mailing list