Skip to content

[DebugInfo] Call std::erase directly (NFC) #136261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

kazutakahirata
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Apr 18, 2025

@llvm/pr-subscribers-debuginfo

Author: Kazu Hirata (kazutakahirata)

Changes

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

1 Files Affected:

  • (modified) llvm/include/llvm/DebugInfo/LogicalView/Core/LVOptions.h (+1-5)
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVOptions.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVOptions.h
index a8bf33f9ad6b2..b60f9e90b4f1c 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVOptions.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVOptions.h
@@ -50,11 +50,7 @@ namespace logicalview {
     return FAMILY.SET.find(TYPE::FIELD) != FAMILY.SET.end();                   \
   }                                                                            \
   void set##FAMILY##FIELD() { FAMILY.SET.insert(TYPE::FIELD); }                \
-  void reset##FAMILY##FIELD() {                                                \
-    std::set<TYPE>::iterator Iter = FAMILY.SET.find(TYPE::FIELD);              \
-    if (Iter != FAMILY.SET.end())                                              \
-      FAMILY.SET.erase(Iter);                                                  \
-  }
+  void reset##FAMILY##FIELD() { FAMILY.SET.erase(TYPE::FIELD); }
 
 #define STDSET_FUNCTION_5(FAMILY, FIELD, ENTRY, TYPE, SET)                     \
   bool get##FAMILY##FIELD##ENTRY() const {                                     \

@kazutakahirata kazutakahirata changed the title [DebugInfo] Call std::set directly (NFC) [DebugInfo] Call std::erase directly (NFC) Apr 18, 2025
@kazutakahirata kazutakahirata merged commit d3d9b37 into llvm:main Apr 18, 2025
11 of 13 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_001_range_erase_llvm_DebugInfo branch April 18, 2025 17:04
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants