[lld] [lld-macho][NFC] Remove redundant checks (PR #67450)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 26 09:11:09 PDT 2023
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lld-macho
<details>
<summary>Changes</summary>
`ignoreAutoLinkOptions` checks run both in `parsereLCLinkerOptions` and `resolveLCLinkerOptions`. Conver the latter check to an assert.
---
Full diff: https://github.com/llvm/llvm-project/pull/67450.diff
1 Files Affected:
- (modified) lld/MachO/Driver.cpp (+2-4)
``````````diff
diff --git a/lld/MachO/Driver.cpp b/lld/MachO/Driver.cpp
index 00ff3439a043be9..5885a1fae4f3431 100644
--- a/lld/MachO/Driver.cpp
+++ b/lld/MachO/Driver.cpp
@@ -514,15 +514,13 @@ void macho::resolveLCLinkerOptions() {
for (unsigned i = 0; i < LCLinkerOptions.size(); ++i) {
StringRef arg = LCLinkerOptions[i];
if (arg.consume_front("-l")) {
- if (config->ignoreAutoLinkOptions.contains(arg))
- continue;
+ assert(!config->ignoreAutoLinkOptions.contains(arg));
addLibrary(arg, /*isNeeded=*/false, /*isWeak=*/false,
/*isReexport=*/false, /*isHidden=*/false,
/*isExplicit=*/false, LoadType::LCLinkerOption);
} else if (arg == "-framework") {
StringRef name = LCLinkerOptions[++i];
- if (config->ignoreAutoLinkOptions.contains(name))
- continue;
+ assert(!config->ignoreAutoLinkOptions.contains(name));
addFramework(name, /*isNeeded=*/false, /*isWeak=*/false,
/*isReexport=*/false, /*isExplicit=*/false,
LoadType::LCLinkerOption);
``````````
</details>
https://github.com/llvm/llvm-project/pull/67450
More information about the llvm-commits
mailing list