[llvm] bed5546 - [DebugInfo] Get rid of redundant conditional checks in `/DebugInfo` (#92111)

via llvm-commits llvm-commits at lists.llvm.org
Wed May 15 08:16:19 PDT 2024


Author: Rajveer Singh Bharadwaj
Date: 2024-05-15T11:16:15-04:00
New Revision: bed5546bb53bdb231b62f569b67f449019426ce8

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

LOG: [DebugInfo] Get rid of redundant conditional checks in `/DebugInfo` (#92111)

Resolves #90326

Added: 
    

Modified: 
    llvm/include/llvm/DebugInfo/LogicalView/Core/LVObject.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVObject.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVObject.h
index 3f7f8c7838fd1..efc8db12a6972 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVObject.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVObject.h
@@ -246,20 +246,17 @@ class LVObject {
   virtual void setName(StringRef ObjectName) {}
 
   LVElement *getParent() const {
-    assert((!Parent.Element ||
-            (Parent.Element && static_cast<LVElement *>(Parent.Element))) &&
+    assert((!Parent.Element || static_cast<LVElement *>(Parent.Element)) &&
            "Invalid element");
     return Parent.Element;
   }
   LVScope *getParentScope() const {
-    assert((!Parent.Scope ||
-            (Parent.Scope && static_cast<LVScope *>(Parent.Scope))) &&
+    assert((!Parent.Scope || static_cast<LVScope *>(Parent.Scope)) &&
            "Invalid scope");
     return Parent.Scope;
   }
   LVSymbol *getParentSymbol() const {
-    assert((!Parent.Symbol ||
-            (Parent.Symbol && static_cast<LVSymbol *>(Parent.Symbol))) &&
+    assert((!Parent.Symbol || static_cast<LVSymbol *>(Parent.Symbol)) &&
            "Invalid symbol");
     return Parent.Symbol;
   }


        


More information about the llvm-commits mailing list