SVN commit 1055941 by rodda: Convenience types to set last type and instance Rearrange usingDeclaration to put parameters which are often left default at the end M +21 -1 abstractexpressionvisitor.h --- trunk/KDE/kdevplatform/language/duchain/builders/abstractexpressionvisitor.h #1055940:1055941 @@ -75,6 +75,17 @@ m_lastType = type; } + void setInstantiatedType(bool instantiated = true) + { + m_lastInstance = Instance(instantiated); + } + + void setInstantiatedType(KDevelop::AbstractType::Ptr type, bool instantiated = true) + { + m_lastType = type; + m_lastInstance = Instance(instantiated); + } + template void setLastType(TypePtr type) { @@ -86,6 +97,15 @@ return m_lastInstance; } + void setLastInstance(Declaration* decl) + { + m_lastInstance = Instance(decl); + if (decl) + m_lastType = decl->abstractType(); + else + m_lastType = 0; + } + protected: KDevelop::AbstractType::Ptr lastType() { @@ -123,7 +143,7 @@ } /** The duchain is not locked when this is called */ - virtual void usingDeclaration( T* node, TokenType start_token, TokenType end_token, const KDevelop::DeclarationPointer& decl ) { + virtual void usingDeclaration( T* node, const KDevelop::DeclarationPointer& decl, TokenType start_token = TokenType(), TokenType end_token = TokenType() ) { Q_UNUSED(node) Q_UNUSED(start_token) Q_UNUSED(end_token) Q_UNUSED(decl) }