[clang] 18d2539 - [StaticAnalyzer] Simplify code with DenseMap::operator[] (NFC) (#115116)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 6 08:36:21 PST 2024
Author: Kazu Hirata
Date: 2024-11-06T08:36:18-08:00
New Revision: 18d2539ce674c1eabac187403257ae53ed2ee264
URL: https://github.com/llvm/llvm-project/commit/18d2539ce674c1eabac187403257ae53ed2ee264
DIFF: https://github.com/llvm/llvm-project/commit/18d2539ce674c1eabac187403257ae53ed2ee264.diff
LOG: [StaticAnalyzer] Simplify code with DenseMap::operator[] (NFC) (#115116)
Added:
Modified:
clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp
Removed:
################################################################################
diff --git a/clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp
index f524c4c067c8c3..e1ad5911ea0b70 100644
--- a/clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp
@@ -131,9 +131,7 @@ class NonLocalizedStringBRVisitor final : public BugReporterVisitor {
#define NEW_RECEIVER(receiver) \
llvm::DenseMap<Selector, uint8_t> &receiver##M = \
- UIMethods.insert({&Ctx.Idents.get(#receiver), \
- llvm::DenseMap<Selector, uint8_t>()}) \
- .first->second;
+ UIMethods[&Ctx.Idents.get(#receiver)];
#define ADD_NULLARY_METHOD(receiver, method, argument) \
receiver##M.insert( \
{Ctx.Selectors.getNullarySelector(&Ctx.Idents.get(#method)), argument});
More information about the cfe-commits
mailing list