diff --git a/language/duchain/classmemberdeclaration.cpp b/language/duchain/classmemberdeclaration.cpp index 6b01748023..4d209b6271 100644 --- a/language/duchain/classmemberdeclaration.cpp +++ b/language/duchain/classmemberdeclaration.cpp @@ -1,190 +1,153 @@ /* This is part of KDevelop Copyright 2002-2005 Roberto Raggi Copyright 2006 Adam Treat Copyright 2006 Hamish Rodda Copyright 2007-2008 David Nolden This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "classmemberdeclaration.h" #include "classmemberdeclarationdata.h" #include "duchainregister.h" #include namespace KDevelop { ClassMemberDeclarationData::ClassMemberDeclarationData() : m_accessPolicy(Declaration::Public) , m_isStatic(false) , m_isAuto(false) , m_isFriend(false) , m_isRegister(false) , m_isExtern(false) , m_isMutable(false) - , m_isNative(false) - , m_isSynchronized(false) - , m_isStrictFP(false) { } ClassMemberDeclaration::ClassMemberDeclaration(const ClassMemberDeclaration& rhs) : Declaration(*new ClassMemberDeclarationData(*rhs.d_func())) { } REGISTER_DUCHAIN_ITEM(ClassMemberDeclaration); Declaration* ClassMemberDeclaration::clonePrivate() const { return new ClassMemberDeclaration(*this); } ClassMemberDeclaration::ClassMemberDeclaration(const RangeInRevision& range, DUContext* context) : Declaration(*new ClassMemberDeclarationData, range ) { d_func_dynamic()->setClassId(this); if( context ) setContext( context ); } ClassMemberDeclaration::ClassMemberDeclaration(ClassMemberDeclarationData& dd, const RangeInRevision& range ) : Declaration(dd, range) { } ClassMemberDeclaration::ClassMemberDeclaration(ClassMemberDeclarationData& dd) : Declaration(dd) { } ClassMemberDeclaration::~ClassMemberDeclaration() { } bool ClassMemberDeclaration::isStatic() const { return d_func()->m_isStatic; } void ClassMemberDeclaration::setStatic(bool isStatic) { d_func_dynamic()->m_isStatic = isStatic; } bool ClassMemberDeclaration::isAuto() const { return d_func()->m_isAuto; } void ClassMemberDeclaration::setAuto(bool isAuto) { d_func_dynamic()->m_isAuto = isAuto; } bool ClassMemberDeclaration::isFriend() const { return d_func()->m_isFriend; } void ClassMemberDeclaration::setFriend(bool isFriend) { d_func_dynamic()->m_isFriend = isFriend; } bool ClassMemberDeclaration::isRegister() const { return d_func()->m_isRegister; } void ClassMemberDeclaration::setRegister(bool isRegister) { d_func_dynamic()->m_isRegister = isRegister; } bool ClassMemberDeclaration::isExtern() const { return d_func()->m_isExtern; } void ClassMemberDeclaration::setExtern(bool isExtern) { d_func_dynamic()->m_isExtern = isExtern; } bool ClassMemberDeclaration::isMutable() const { return d_func()->m_isMutable; } void ClassMemberDeclaration::setMutable(bool isMutable) { d_func_dynamic()->m_isMutable = isMutable; } Declaration::AccessPolicy ClassMemberDeclaration::accessPolicy() const { return d_func()->m_accessPolicy; } void ClassMemberDeclaration::setAccessPolicy(Declaration::AccessPolicy accessPolicy) { d_func_dynamic()->m_accessPolicy = accessPolicy; } -bool ClassMemberDeclaration::isNative() const -{ - return d_func()->m_isNative; -} - -void ClassMemberDeclaration::setNative(bool native) -{ - d_func_dynamic()->m_isNative = native; -} - -bool ClassMemberDeclaration::isStrictFP() const -{ - return d_func()->m_isStrictFP; -} - -void ClassMemberDeclaration::setStrictFP(bool strictFP) -{ - d_func_dynamic()->m_isStrictFP = strictFP; -} - -bool ClassMemberDeclaration::isSynchronized() const -{ - return d_func()->m_isSynchronized; -} - -void ClassMemberDeclaration::setSynchronized(bool synchronized) -{ - d_func_dynamic()->m_isSynchronized = synchronized; -} - void ClassMemberDeclaration::setStorageSpecifiers(StorageSpecifiers specifiers) { DUCHAIN_D_DYNAMIC(ClassMemberDeclaration); d->m_isStatic = specifiers & StaticSpecifier; d->m_isAuto = specifiers & AutoSpecifier; d->m_isFriend = specifiers & FriendSpecifier; d->m_isRegister = specifiers & RegisterSpecifier; d->m_isExtern = specifiers & ExternSpecifier; d->m_isMutable = specifiers & MutableSpecifier; - d->m_isFinal = specifiers & FinalSpecifier; - d->m_isSynchronized = specifiers & SynchronizedSpecifier; - d->m_isNative = specifiers & NativeSpecifier; - d->m_isStrictFP = specifiers & StrictFPSpecifier; } } diff --git a/language/duchain/classmemberdeclaration.h b/language/duchain/classmemberdeclaration.h index 2ac453a979..f3bd0166f7 100644 --- a/language/duchain/classmemberdeclaration.h +++ b/language/duchain/classmemberdeclaration.h @@ -1,103 +1,90 @@ /* This file is part of KDevelop Copyright 2002-2005 Roberto Raggi Copyright 2006 Adam Treat Copyright 2006 Hamish Rodda Copyright 2007-2008 David Nolden This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef KDEVPLATFORM_CLASSMEMBERDECLARATION_H #define KDEVPLATFORM_CLASSMEMBERDECLARATION_H #include "declaration.h" namespace KDevelop { class ClassMemberDeclarationData; /** * Represents a single class member definition in a definition-use chain. */ class KDEVPLATFORMLANGUAGE_EXPORT ClassMemberDeclaration : public Declaration { public: ClassMemberDeclaration(const ClassMemberDeclaration& rhs); ClassMemberDeclaration(const RangeInRevision& range, DUContext* context); explicit ClassMemberDeclaration(ClassMemberDeclarationData& dd); ~ClassMemberDeclaration(); AccessPolicy accessPolicy() const; void setAccessPolicy(AccessPolicy accessPolicy); enum StorageSpecifier { StaticSpecifier = 0x1 /**< indicates static member */, AutoSpecifier = 0x2 /**< indicates automatic determination of member access */, FriendSpecifier = 0x4 /**< indicates friend member */, ExternSpecifier = 0x8 /**< indicates external declaration */, RegisterSpecifier = 0x10 /**< indicates register */, - MutableSpecifier = 0x20 /**< indicates a mutable member */, - FinalSpecifier = 0x40 /**< indicates a final declaration */, - NativeSpecifier = 0x80, - SynchronizedSpecifier = 0x100, - StrictFPSpecifier = 0x200, + MutableSpecifier = 0x20 /**< indicates a mutable member */ }; Q_DECLARE_FLAGS(StorageSpecifiers, StorageSpecifier) void setStorageSpecifiers(StorageSpecifiers specifiers); bool isStatic() const; void setStatic(bool isStatic); bool isAuto() const; void setAuto(bool isAuto); bool isFriend() const; void setFriend(bool isFriend); bool isRegister() const; void setRegister(bool isRegister); bool isExtern() const; void setExtern(bool isExtern); bool isMutable() const; void setMutable(bool isMutable); - bool isNative() const; - void setNative(bool native); - - bool isSynchronized() const; - void setSynchronized(bool synchronized); - - bool isStrictFP() const; - void setStrictFP(bool strictFP); - enum { Identity = 9 }; protected: ClassMemberDeclaration(ClassMemberDeclarationData& dd, const RangeInRevision& range); DUCHAIN_DECLARE_DATA(ClassMemberDeclaration) private: Declaration* clonePrivate() const override; }; } Q_DECLARE_OPERATORS_FOR_FLAGS(KDevelop::ClassMemberDeclaration::StorageSpecifiers) #endif // KDEVPLATFORM_CLASSMEMBERDECLARATION_H diff --git a/language/duchain/classmemberdeclarationdata.h b/language/duchain/classmemberdeclarationdata.h index 08fb345ffc..e5cdd478ec 100644 --- a/language/duchain/classmemberdeclarationdata.h +++ b/language/duchain/classmemberdeclarationdata.h @@ -1,52 +1,48 @@ /* This is part of KDevelop Copyright 2002-2005 Roberto Raggi Copyright 2006 Adam Treat Copyright 2006 Hamish Rodda Copyright 2007-2008 David Nolden This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef KDEVPLATFORM_CLASSMEMBERDECLARATIONDATA_H #define KDEVPLATFORM_CLASSMEMBERDECLARATIONDATA_H #include "declarationdata.h" #include namespace KDevelop { class KDEVPLATFORMLANGUAGE_EXPORT ClassMemberDeclarationData : public DeclarationData { public: ClassMemberDeclarationData(); ClassMemberDeclarationData( const ClassMemberDeclarationData& rhs ) = default; Declaration::AccessPolicy m_accessPolicy; bool m_isStatic: 1; bool m_isAuto: 1; bool m_isFriend: 1; bool m_isRegister: 1; bool m_isExtern: 1; bool m_isMutable: 1; - bool m_isFinal: 1; - bool m_isNative: 1; - bool m_isSynchronized: 1; - bool m_isStrictFP: 1; }; } #endif