[clang] 5bd6bd1 - [clang][Interp][NFC] Simplify visitReturnStmt()

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 7 00:42:58 PST 2022


Author: Timm Bäder
Date: 2022-11-07T09:42:41+01:00
New Revision: 5bd6bd12276ff5e5c38002cf607976e8ac9ed8a6

URL: https://github.com/llvm/llvm-project/commit/5bd6bd12276ff5e5c38002cf607976e8ac9ed8a6
DIFF: https://github.com/llvm/llvm-project/commit/5bd6bd12276ff5e5c38002cf607976e8ac9ed8a6.diff

LOG: [clang][Interp][NFC] Simplify visitReturnStmt()

Added: 
    

Modified: 
    clang/lib/AST/Interp/ByteCodeStmtGen.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/ByteCodeStmtGen.cpp b/clang/lib/AST/Interp/ByteCodeStmtGen.cpp
index 81243d846bc1..a6aa8d88622a 100644
--- a/clang/lib/AST/Interp/ByteCodeStmtGen.cpp
+++ b/clang/lib/AST/Interp/ByteCodeStmtGen.cpp
@@ -237,12 +237,11 @@ bool ByteCodeStmtGen<Emitter>::visitReturnStmt(const ReturnStmt *RS) {
       this->emitCleanup();
       return this->emitRetVoid(RS);
     }
-  } else {
-    this->emitCleanup();
-    if (!this->emitRetVoid(RS))
-      return false;
-    return true;
   }
+
+  // Void return.
+  this->emitCleanup();
+  return this->emitRetVoid(RS);
 }
 
 template <class Emitter>


        


More information about the cfe-commits mailing list