[clang] [clang] Remove a redundant check in Mangle. NFC (PR #95071)

2024-06-11 Thread Pavel Samolysov via cfe-commits

https://github.com/samolisov closed 
https://github.com/llvm/llvm-project/pull/95071
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] Remove a redundant check in Mangle. NFC (PR #95071)

2024-06-11 Thread DonĂ¡t Nagy via cfe-commits

https://github.com/NagyDonat approved this pull request.


https://github.com/llvm/llvm-project/pull/95071
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] Remove a redundant check in Mangle. NFC (PR #95071)

2024-06-10 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-clang

Author: Pavel Samolysov (samolisov)


Changes

This addresses a review comment for PR #94987 Because that PR is a big 
automatic change, this change was moved in a separate one.

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


1 Files Affected:

- (modified) clang/lib/AST/Mangle.cpp (+2-3) 


``diff
diff --git a/clang/lib/AST/Mangle.cpp b/clang/lib/AST/Mangle.cpp
index 4af4d7c00c5cb..4fbf0e3b42dbc 100644
--- a/clang/lib/AST/Mangle.cpp
+++ b/clang/lib/AST/Mangle.cpp
@@ -301,9 +301,8 @@ void MangleContext::mangleBlock(const DeclContext *DC, 
const BlockDecl *BD,
   } else {
 assert((isa(DC) || isa(DC)) &&
"expected a NamedDecl or BlockDecl");
-if (isa(DC))
-  for (; isa_and_nonnull(DC); DC = DC->getParent())
-(void) getBlockId(cast(DC), true);
+for (; isa_and_nonnull(DC); DC = DC->getParent())
+  (void)getBlockId(cast(DC), true);
 assert((isa(DC) || isa(DC)) &&
"expected a TranslationUnitDecl or a NamedDecl");
 if (const auto *CD = dyn_cast(DC))

``




https://github.com/llvm/llvm-project/pull/95071
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] Remove a redundant check in Mangle. NFC (PR #95071)

2024-06-10 Thread Pavel Samolysov via cfe-commits

https://github.com/samolisov created 
https://github.com/llvm/llvm-project/pull/95071

This addresses a review comment for PR #94987 Because that PR is a big 
automatic change, this change was moved in a separate one.

>From c0e810f0a8d17ce222ad0775874539e09a90eb33 Mon Sep 17 00:00:00 2001
From: Pavel Samolysov 
Date: Mon, 10 Jun 2024 20:29:16 +0300
Subject: [PATCH] [clang] Remove a redundant check in Mangle. NFC

This addresses a review comment for PR #94987 Because that PR is a big
automatic change, this change was moved in a separate one.
---
 clang/lib/AST/Mangle.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/clang/lib/AST/Mangle.cpp b/clang/lib/AST/Mangle.cpp
index 4af4d7c00c5cb..4fbf0e3b42dbc 100644
--- a/clang/lib/AST/Mangle.cpp
+++ b/clang/lib/AST/Mangle.cpp
@@ -301,9 +301,8 @@ void MangleContext::mangleBlock(const DeclContext *DC, 
const BlockDecl *BD,
   } else {
 assert((isa(DC) || isa(DC)) &&
"expected a NamedDecl or BlockDecl");
-if (isa(DC))
-  for (; isa_and_nonnull(DC); DC = DC->getParent())
-(void) getBlockId(cast(DC), true);
+for (; isa_and_nonnull(DC); DC = DC->getParent())
+  (void)getBlockId(cast(DC), true);
 assert((isa(DC) || isa(DC)) &&
"expected a TranslationUnitDecl or a NamedDecl");
 if (const auto *CD = dyn_cast(DC))

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits