Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit f022855a authored by David Nolden's avatar David Nolden

Also register template declarations and c++ context specializations so they can be stored to disk

parent 8622095d
......@@ -18,11 +18,18 @@
#include "cppducontext.h"
#include "navigationwidget.h"
#include <duchainregister.h>
namespace Cpp {
QMutex cppDuContextInstantiationsMutex(QMutex::Recursive);
typedef CppDUContext<TopDUContext> CppTopDUContext;
REGISTER_DUCHAIN_ITEM_WITH_DATA(CppTopDUContext, TopDUContextData);
typedef CppDUContext<TopDUContext> CppDUContext;
REGISTER_DUCHAIN_ITEM_WITH_DATA(CppDUContext, DUContextData);
template<>
QWidget* CppDUContext<TopDUContext>::createNavigationWidget( Declaration* decl, TopDUContext* topContext, const QString& htmlPrefix, const QString& htmlSuffix ) const {
if( decl == 0 ) {
......
......@@ -480,6 +480,10 @@ class CppDUContext : public BaseContext {
virtual QWidget* createNavigationWidget(Declaration* decl, TopDUContext* topContext, const QString& htmlPrefix, const QString& htmlSuffix) const;
enum {
Identity = BaseContext::Identity + 50
};
private:
~CppDUContext() {
//Delete all the local declarations first, so they also delete their instantiations
......
......@@ -25,17 +25,31 @@
#include <duchain/declaration.h>
#include <duchain/forwarddeclaration.h>
#include <duchain/aliasdeclaration.h>
#include <duchain/functiondeclaration.h>
#include <duchain/repositories/itemrepository.h>
#include <duchain/classfunctiondeclaration.h>
#include <appendedlist.h>
#include "templateparameterdeclaration.h"
#include "cppducontext.h"
#include "expressionparser.h"
#include "classdeclaration.h"
#include <duchainregister.h>
using namespace KDevelop;
using namespace Cpp;
#define REGISTER_TEMPLATE_DECLARATION(Declaration) typedef TemplateDeclaration<Declaration> Template ## Declaration; REGISTER_DUCHAIN_ITEM_WITH_DATA(Template ## Declaration, Declaration ## Data);
REGISTER_TEMPLATE_DECLARATION(Declaration);
REGISTER_TEMPLATE_DECLARATION(ClassDeclaration);
REGISTER_TEMPLATE_DECLARATION(ClassFunctionDeclaration);
REGISTER_TEMPLATE_DECLARATION(ClassMemberDeclaration);
REGISTER_TEMPLATE_DECLARATION(FunctionDeclaration);
REGISTER_TEMPLATE_DECLARATION(AliasDeclaration);
REGISTER_TEMPLATE_DECLARATION(ForwardDeclaration);
QMutex TemplateDeclaration::instantiationsMutex(QMutex::Recursive);
typedef CppDUContext<KDevelop::DUContext> StandardCppDUContext;
......
......@@ -223,6 +223,11 @@ namespace Cpp {
Q_ASSERT(0);
return 0;
}
enum {
Identity = BaseDeclaration::Identity + 50
};
};
bool KDEVCPPDUCHAIN_EXPORT isTemplateDeclaration(const KDevelop::Declaration*);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment