diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVOptions.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVOptions.h --- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVOptions.h +++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVOptions.h @@ -511,8 +511,8 @@ void resolveGenericPatternMatch(T *Element, const U &Requests) { assert(Element && "Element must not be nullptr"); auto CheckPattern = [=]() -> bool { - return Element->isNamed() && - (matchGenericPattern(Element->getName()) || + return (Element->isNamed() && matchGenericPattern(Element->getName())) || + (Element->isTyped() && matchGenericPattern(Element->getTypeName())); }; auto CheckOffset = [=]() -> bool { diff --git a/llvm/lib/DebugInfo/LogicalView/Core/LVOptions.cpp b/llvm/lib/DebugInfo/LogicalView/Core/LVOptions.cpp --- a/llvm/lib/DebugInfo/LogicalView/Core/LVOptions.cpp +++ b/llvm/lib/DebugInfo/LogicalView/Core/LVOptions.cpp @@ -505,6 +505,9 @@ // Match a general pattern. bool LVPatterns::matchPattern(StringRef Input, const LVMatchInfo &MatchInfo) { bool Matched = false; + // Do not match an empty 'Input'. + if (Input.empty()) + return Matched; // Traverse all match specifications. for (const LVMatch &Match : MatchInfo) { switch (Match.Mode) {