[llvm] [DebugInfo] Get rid of redundant conditional checks in `/DebugInfo` (PR #92111)
via llvm-commits
llvm-commits at lists.llvm.org
Tue May 14 05:44:27 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-debuginfo
Author: Rajveer Singh Bharadwaj (Rajveer100)
<details>
<summary>Changes</summary>
Resolves #<!-- -->90326
---
Full diff: https://github.com/llvm/llvm-project/pull/92111.diff
1 Files Affected:
- (modified) llvm/include/llvm/DebugInfo/LogicalView/Core/LVObject.h (+3-6)
``````````diff
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;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/92111
More information about the llvm-commits
mailing list