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

Youngsuk Kim via llvm-commits llvm-commits at lists.llvm.org
Wed May 15 08:15:54 PDT 2024


================
@@ -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)) &&
----------------
JOE1994 wrote:

Oops, please disregard my previous comment.. `Parent.Element` is converted to bool before the `!` operator is applied, so there aren't any issues with the original assert.

https://github.com/llvm/llvm-project/pull/92111


More information about the llvm-commits mailing list