aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/ELF.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2025-05-26 15:13:02 -0700
committerGitHub <noreply@github.com>2025-05-26 15:13:02 -0700
commit89308de4b0f4f20c685c6d9cecd6dabe117080b4 (patch)
treec228c4dc6bb19902e5d6f72dc6438a6e59f7dabe /llvm/lib/Object/ELF.cpp
parenta0c33e535b1239404f0ff466e979e1f57dbf804e (diff)
downloadllvm-89308de4b0f4f20c685c6d9cecd6dabe117080b4.zip
llvm-89308de4b0f4f20c685c6d9cecd6dabe117080b4.tar.gz
llvm-89308de4b0f4f20c685c6d9cecd6dabe117080b4.tar.bz2
[llvm] Value-initialize values with *Map::try_emplace (NFC) (#141522)
try_emplace value-initializes values, so we do not need to pass nullptr to try_emplace when the value types are raw pointers or std::unique_ptr<T>.
Diffstat (limited to 'llvm/lib/Object/ELF.cpp')
-rw-r--r--llvm/lib/Object/ELF.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Object/ELF.cpp b/llvm/lib/Object/ELF.cpp
index bf42c92a..dfc8acb 100644
--- a/llvm/lib/Object/ELF.cpp
+++ b/llvm/lib/Object/ELF.cpp
@@ -965,8 +965,7 @@ ELFFile<ELFT>::getSectionAndRelocations(
continue;
}
if (*DoesSectionMatch) {
- if (SecToRelocMap.insert(std::make_pair(&Sec, (const Elf_Shdr *)nullptr))
- .second)
+ if (SecToRelocMap.try_emplace(&Sec).second)
continue;
}