diff options
author | Anders Carlsson <andersca@mac.com> | 2011-01-20 05:36:44 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2011-01-20 05:36:44 +0000 |
commit | c0534b6cdc414aa86ef7e9ab37f7a81a79140f02 (patch) | |
tree | ea68308c2e2c7bc4b523ac4d6acd06d6c4bb9f34 | |
parent | 98367f0322ac43fa5b0c7ccb33bab95f66b960f6 (diff) |
Add IsMarkedOverride and IsMarkedFinal flags to FunctionDecl (to be used by CXXRecordDecl).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123885 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/AST/Decl.h | 16 | ||||
-rw-r--r-- | lib/Serialization/ASTReaderDecl.cpp | 3 | ||||
-rw-r--r-- | lib/Serialization/ASTWriterDecl.cpp | 2 |
3 files changed, 19 insertions, 2 deletions
diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index b7fcbe9652..fe4b71ccc1 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -1195,6 +1195,8 @@ private: bool IsDeleted : 1; bool IsTrivial : 1; // sunk from CXXMethodDecl bool HasImplicitReturnZero : 1; + bool IsMarkedOverride : 1; // sunk from CXXMethodDecl + bool IsMarkedFinal : 1; // sunk from CXXMethodDecl /// \brief End part of this FunctionDecl's source range. /// @@ -1274,8 +1276,8 @@ protected: IsInline(isInlineSpecified), IsInlineSpecified(isInlineSpecified), IsVirtualAsWritten(false), IsPure(false), HasInheritedPrototype(false), HasWrittenPrototype(true), IsDeleted(false), IsTrivial(false), - HasImplicitReturnZero(false), - EndRangeLoc(NameInfo.getEndLoc()), + HasImplicitReturnZero(false), IsMarkedOverride(false), + IsMarkedFinal(false), EndRangeLoc(NameInfo.getEndLoc()), TemplateOrSpecialization(), DNLoc(NameInfo.getInfo()) {} @@ -1388,6 +1390,16 @@ public: bool hasImplicitReturnZero() const { return HasImplicitReturnZero; } void setHasImplicitReturnZero(bool IRZ) { HasImplicitReturnZero = IRZ; } + /// \brief Whether this member function is marked with the 'override' keyword, + /// C++0x [class.mem]p8. + bool isMarkedOverride() const { return IsMarkedOverride; } + void setIsMarkedOverride(bool IMO) { IsMarkedOverride = IMO; } + + /// \brief Whether this member function is marked with the 'final' keyword, + /// C++0x [class.mem]p8. + bool isMarkedFinal() const { return IsMarkedFinal; } + void setIsMarkedFinal(bool IMF) { IsMarkedFinal = IMF; } + /// \brief Whether this function has a prototype, either because one /// was explicitly written or because it was "inherited" by merging /// a declaration without a prototype with a declaration that has a diff --git a/lib/Serialization/ASTReaderDecl.cpp b/lib/Serialization/ASTReaderDecl.cpp index 757433228f..190f584a04 100644 --- a/lib/Serialization/ASTReaderDecl.cpp +++ b/lib/Serialization/ASTReaderDecl.cpp @@ -395,6 +395,9 @@ void ASTDeclReader::VisitFunctionDecl(FunctionDecl *FD) { FD->IsDeleted = Record[Idx++]; FD->IsTrivial = Record[Idx++]; FD->HasImplicitReturnZero = Record[Idx++]; + FD->IsMarkedOverride = Record[Idx++]; + FD->IsMarkedFinal = Record[Idx++]; + FD->EndRangeLoc = ReadSourceLocation(Record, Idx); // Read in the parameters. diff --git a/lib/Serialization/ASTWriterDecl.cpp b/lib/Serialization/ASTWriterDecl.cpp index 507c66931c..88ff1a7c9b 100644 --- a/lib/Serialization/ASTWriterDecl.cpp +++ b/lib/Serialization/ASTWriterDecl.cpp @@ -312,6 +312,8 @@ void ASTDeclWriter::VisitFunctionDecl(FunctionDecl *D) { Record.push_back(D->isDeleted()); Record.push_back(D->isTrivial()); Record.push_back(D->hasImplicitReturnZero()); + Record.push_back(D->isMarkedOverride()); + Record.push_back(D->isMarkedFinal()); Writer.AddSourceLocation(D->getLocEnd(), Record); Record.push_back(D->param_size()); |