[clang] [AST] Use llvm::iterator_range::empty (NFC) (PR #151800)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 1 23:46:34 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Kazu Hirata (kazutakahirata)
<details>
<summary>Changes</summary>
With empty, we don't have to repeat the whole expression.
---
Full diff: https://github.com/llvm/llvm-project/pull/151800.diff
1 Files Affected:
- (modified) clang/lib/AST/MicrosoftMangle.cpp (+1-2)
``````````diff
diff --git a/clang/lib/AST/MicrosoftMangle.cpp b/clang/lib/AST/MicrosoftMangle.cpp
index bc47e0506add0..e6ea0ada2e9ec 100644
--- a/clang/lib/AST/MicrosoftMangle.cpp
+++ b/clang/lib/AST/MicrosoftMangle.cpp
@@ -1298,8 +1298,7 @@ void MicrosoftCXXNameMangler::mangleUnqualifiedName(GlobalDecl GD,
Name += "<unnamed-type-";
Name += TND->getName();
} else if (isa<EnumDecl>(TD) &&
- cast<EnumDecl>(TD)->enumerator_begin() !=
- cast<EnumDecl>(TD)->enumerator_end()) {
+ !cast<EnumDecl>(TD)->enumerators().empty()) {
// Anonymous non-empty enums mangle in the first enumerator.
auto *ED = cast<EnumDecl>(TD);
Name += "<unnamed-enum-";
``````````
</details>
https://github.com/llvm/llvm-project/pull/151800
More information about the cfe-commits
mailing list