[clang] 4f8668d - [clang] co_return cleanup

Nathan Sidwell via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 8 08:09:00 PDT 2022


Author: Nathan Sidwell
Date: 2022-06-08T08:08:42-07:00
New Revision: 4f8668d9f73a0dc234ebf9938bcf24061991e9ae

URL: https://github.com/llvm/llvm-project/commit/4f8668d9f73a0dc234ebf9938bcf24061991e9ae
DIFF: https://github.com/llvm/llvm-project/commit/4f8668d9f73a0dc234ebf9938bcf24061991e9ae.diff

LOG: [clang] co_return cleanup

There's no need for the CoreturnStmt getChildren member to deal with
the presence or absence of the operand member. All users already deal
with null children.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D125542

Added: 
    

Modified: 
    clang/include/clang/AST/StmtCXX.h

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/AST/StmtCXX.h b/clang/include/clang/AST/StmtCXX.h
index 5ccf6904048e3..2c71f86768963 100644
--- a/clang/include/clang/AST/StmtCXX.h
+++ b/clang/include/clang/AST/StmtCXX.h
@@ -497,16 +497,10 @@ class CoreturnStmt : public Stmt {
   }
 
   child_range children() {
-    if (!getOperand())
-      return child_range(SubStmts + SubStmt::PromiseCall,
-                         SubStmts + SubStmt::Count);
     return child_range(SubStmts, SubStmts + SubStmt::Count);
   }
 
   const_child_range children() const {
-    if (!getOperand())
-      return const_child_range(SubStmts + SubStmt::PromiseCall,
-                               SubStmts + SubStmt::Count);
     return const_child_range(SubStmts, SubStmts + SubStmt::Count);
   }
 


        


More information about the cfe-commits mailing list