diff options
author | Anders Carlsson <andersca@mac.com> | 2011-01-22 17:22:48 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2011-01-22 17:22:48 +0000 |
commit | b76cc4d4445fd9e5b29722407ce870e3f5a64cca (patch) | |
tree | ca5a6c7c64315731cef47fbeb6f61ec543849b77 | |
parent | cc54d594d4f6509c0e3a8e349e481d9b5d899df6 (diff) |
Add final/explicit getters and setters to CXXRecordDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124037 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/AST/DeclCXX.h | 20 | ||||
-rw-r--r-- | lib/AST/DeclCXX.cpp | 1 |
2 files changed, 20 insertions, 1 deletions
diff --git a/include/clang/AST/DeclCXX.h b/include/clang/AST/DeclCXX.h index ffa459e673..cc3e4a52aa 100644 --- a/include/clang/AST/DeclCXX.h +++ b/include/clang/AST/DeclCXX.h @@ -356,6 +356,12 @@ class CXXRecordDecl : public RecordDecl { /// \brief Whether we have already declared a destructor within the class. bool DeclaredDestructor : 1; + /// \brief Whether this class is marked 'final'. + bool IsMarkedFinal : 1; + + /// \brief Whether this class is marked 'explicit'. + bool IsMarkedExplicit : 1; + /// NumBases - The number of base class specifiers in Bases. unsigned NumBases; @@ -658,7 +664,19 @@ public: /// /// This value is used for lazy creation of destructors. bool hasDeclaredDestructor() const { return data().DeclaredDestructor; } - + + /// \brief Whether this class is marked 'final'. + bool isMarkedFinal() const { return data().IsMarkedFinal; } + + /// \brief Mark this class as 'final'. + void setIsMarkedFinal(bool IMF) { data().IsMarkedFinal = IMF; } + + /// \brief Whether this class is marked 'explicit'. + bool isMarkedExplicit() const { return data().IsMarkedExplicit; } + + /// \brief Mark this class as 'explicit'. + void setIsMarkedExplicit(bool IME) { data().IsMarkedExplicit = IME; } + /// getConversions - Retrieve the overload set containing all of the /// conversion functions in this class. UnresolvedSetImpl *getConversionFunctions() { diff --git a/lib/AST/DeclCXX.cpp b/lib/AST/DeclCXX.cpp index 334ee795f3..370cbfc0f1 100644 --- a/lib/AST/DeclCXX.cpp +++ b/lib/AST/DeclCXX.cpp @@ -36,6 +36,7 @@ CXXRecordDecl::DefinitionData::DefinitionData(CXXRecordDecl *D) HasTrivialDestructor(true), ComputedVisibleConversions(false), DeclaredDefaultConstructor(false), DeclaredCopyConstructor(false), DeclaredCopyAssignment(false), DeclaredDestructor(false), + IsMarkedFinal(false), IsMarkedExplicit(false), NumBases(0), NumVBases(0), Bases(), VBases(), Definition(D), FirstFriend(0) { } |