aboutsummaryrefslogtreecommitdiff
path: root/lld/MachO/SymbolTable.cpp
diff options
context:
space:
mode:
authorMax Graey <maxgraey@gmail.com>2025-05-13 17:34:42 +0300
committerGitHub <noreply@github.com>2025-05-13 22:34:42 +0800
commit8aaac80ddde6a23527d3caa98ec998ebe402e0d9 (patch)
tree74a34bbfc8d403d5968f1c13d2047da6ee381f04 /lld/MachO/SymbolTable.cpp
parentac583df03b3c1b2cc3ef7ececbeca697f3449bec (diff)
downloadllvm-8aaac80ddde6a23527d3caa98ec998ebe402e0d9.tar.gz
llvm-8aaac80ddde6a23527d3caa98ec998ebe402e0d9.tar.bz2
llvm-8aaac80ddde6a23527d3caa98ec998ebe402e0d9.zip
[NFC] Use more isa and isa_and_nonnull instead dyn_cast for predicates (#137393)
Also fix some typos in comments --------- Co-authored-by: Mehdi Amini <joker.eph@gmail.com>
Diffstat (limited to 'lld/MachO/SymbolTable.cpp')
-rw-r--r--lld/MachO/SymbolTable.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lld/MachO/SymbolTable.cpp b/lld/MachO/SymbolTable.cpp
index ad48e909903b..baddddcb76fb 100644
--- a/lld/MachO/SymbolTable.cpp
+++ b/lld/MachO/SymbolTable.cpp
@@ -518,7 +518,7 @@ static const Symbol *getAlternativeSpelling(const Undefined &sym,
// If in the symbol table and not undefined.
if (const Symbol *s = symtab->find(newName))
- if (dyn_cast<Undefined>(s) == nullptr)
+ if (!isa<Undefined>(s))
return s;
return nullptr;
@@ -567,8 +567,7 @@ static const Symbol *getAlternativeSpelling(const Undefined &sym,
if (name.equals_insensitive(it.first))
return it.second;
for (Symbol *sym : symtab->getSymbols())
- if (dyn_cast<Undefined>(sym) == nullptr &&
- name.equals_insensitive(sym->getName()))
+ if (!isa<Undefined>(sym) && name.equals_insensitive(sym->getName()))
return sym;
// The reference may be a mangled name while the definition is not. Suggest a