ClassScopeRawPtr BlockScope::findExactClass(ClassScopeRawPtr cls) { if (ClassScopeRawPtr currentCls = getContainingClass()) { if (cls->getName() == currentCls->getName()) { return currentCls; } } return ClassScopeRawPtr(); }
ClassScopeRawPtr BlockScope::findExactClass(ClassScopeRawPtr cls) { if (ClassScopeRawPtr currentCls = getContainingClass()) { if (cls->getName() == currentCls->getName()) { return currentCls; } } if (FileScopePtr currentFile = getContainingFile()) { return currentFile->resolveClass(cls); } return ClassScopeRawPtr(); }
ClassScopePtr StaticClassName::resolveClass() { m_present = false; m_unknown = true; if (m_class) return ClassScopePtr(); BlockScopeRawPtr scope = originalScope(this); if (m_self) { if (ClassScopePtr self = scope->getContainingClass()) { m_className = self->getName(); m_origClassName = self->getOriginalName(); m_present = true; m_unknown = false; return self; } } else if (m_parent) { if (ClassScopePtr self = scope->getContainingClass()) { if (!self->getOriginalParent().empty()) { m_className = Util::toLower(self->getOriginalParent()); m_origClassName = self->getOriginalParent(); m_present = true; } } else { m_parent = false; } } ClassScopePtr cls = scope->getContainingProgram()->findClass(m_className); if (cls) { m_unknown = false; if (cls->isVolatile()) { ClassScopeRawPtr c = scope->getContainingFile()->resolveClass(cls); if (!c) { c = scope->getContainingClass(); if (c && c->getName() != m_className) c.reset(); } m_present = c.get() != 0; if (cls->isRedeclaring()) { cls = c; if (!m_present) m_redeclared = true; } } else { m_present = true; } } return cls; }
int CodeGenerator::ClassScopeCompare::cmp(const ClassScopeRawPtr &p1, const ClassScopeRawPtr &p2) const { int d = p1->getRedeclaringId() - p2->getRedeclaringId(); if (d) return d; return strcasecmp(p1->getName().c_str(), p2->getName().c_str()); }
void AnalysisResult::addSystemClass(ClassScopeRawPtr cs) { ClassScopePtr& entry = m_systemClasses[cs->getName()]; assert(!entry); entry = cs; }