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

Resolves #90326
This commit is contained in:
Rajveer Singh Bharadwaj
2024-05-15 20:46:15 +05:30
committed by GitHub
parent b576a6b045
commit bed5546bb5

View File

@@ -246,20 +246,17 @@ public:
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;
}