Skip to content

Conversation

@kazutakahirata
Copy link
Contributor

No description provided.

@kazutakahirata kazutakahirata requested a review from nikic November 6, 2024 04:59
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:static analyzer labels Nov 6, 2024
@llvmbot
Copy link
Member

llvmbot commented Nov 6, 2024

@llvm/pr-subscribers-clang-static-analyzer-1

@llvm/pr-subscribers-clang

Author: Kazu Hirata (kazutakahirata)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/115116.diff

1 Files Affected:

  • (modified) clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp (+1-3)
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});

Copy link
Contributor

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kazutakahirata kazutakahirata merged commit 18d2539 into llvm:main Nov 6, 2024
11 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_001_operator_sq_br_StaticAnalyzer branch November 6, 2024 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:static analyzer clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants