ClassScopePtr Type::getClass(AnalysisResultPtr ar, BlockScopeRawPtr scope) { if (m_name.empty()) return ClassScopePtr(); ClassScopePtr cls = ar->findClass(m_name); if (cls->isRedeclaring()) { if (!scope) { cls.reset(); } else { cls = scope->findExactClass(Util::toLower(m_name)); } } return cls; }
static inline string GetDocName(AnalysisResultPtr ar, BlockScopeRawPtr scope, const string &name) { ClassScopePtr c(ar->findClass(name)); if (c && c->isRedeclaring()) { ClassScopePtr exact(scope->findExactClass(c)); return exact ? exact->getDocName() : c->getScopeName(); // if we can't tell which redec class, // then don't use the redec name } // TODO: pick a better way of signaling unknown? return c ? c->getDocName() : "UnknownClass"; }