[clang] b1a0197 - [clang][Interp][NFC] Remove unnecessary else blocks

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 5 00:06:58 PDT 2023


Author: Timm Bäder
Date: 2023-07-05T09:05:54+02:00
New Revision: b1a019747e6862346bc3c9b679e4d46baaff5ab9

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

LOG: [clang][Interp][NFC] Remove unnecessary else blocks

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/Pointer.cpp b/clang/lib/AST/Interp/Pointer.cpp
index 7f127143a99d80..9c55a55d42a74f 100644
--- a/clang/lib/AST/Interp/Pointer.cpp
+++ b/clang/lib/AST/Interp/Pointer.cpp
@@ -159,10 +159,10 @@ bool Pointer::isInitialized() const {
     if (Map == (InitMap *)-1)
       return true;
     return Map->isInitialized(getIndex());
-  } else {
-    // Field has its bit in an inline descriptor.
-    return Base == 0 || getInlineDesc()->IsInitialized;
   }
+
+  // Field has its bit in an inline descriptor.
+  return Base == 0 || getInlineDesc()->IsInitialized;
 }
 
 void Pointer::initialize() const {
@@ -185,11 +185,11 @@ void Pointer::initialize() const {
       free(Map);
       Map = (InitMap *)-1;
     }
-  } else {
-    // Field has its bit in an inline descriptor.
-    assert(Base != 0 && "Only composite fields can be initialised");
-    getInlineDesc()->IsInitialized = true;
   }
+
+  // Field has its bit in an inline descriptor.
+  assert(Base != 0 && "Only composite fields can be initialised");
+  getInlineDesc()->IsInitialized = true;
 }
 
 void Pointer::activate() const {


        


More information about the cfe-commits mailing list