[cfe-commits] r124032 - in /cfe/trunk: include/clang/Sema/DeclSpec.h lib/Sema/DeclSpec.cpp
Anders Carlsson
andersca at mac.com
Sat Jan 22 07:11:37 PST 2011
Author: andersca
Date: Sat Jan 22 09:11:37 2011
New Revision: 124032
URL: http://llvm.org/viewvc/llvm-project?rev=124032&view=rev
Log:
Start stubbing out a ClassVirtSpecifiers class.
Modified:
cfe/trunk/include/clang/Sema/DeclSpec.h
cfe/trunk/lib/Sema/DeclSpec.cpp
Modified: cfe/trunk/include/clang/Sema/DeclSpec.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/DeclSpec.h?rev=124032&r1=124031&r2=124032&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/DeclSpec.h (original)
+++ cfe/trunk/include/clang/Sema/DeclSpec.h Sat Jan 22 09:11:37 2011
@@ -1468,7 +1468,7 @@
}
};
-///
+/// VirtSpecifiers - Represents a C++0x virt-specifier-seq.
class VirtSpecifiers {
public:
enum VirtSpecifier {
@@ -1501,6 +1501,31 @@
};
+/// ClassVirtSpecifiers - Represents a C++0x class-virt-specifier-seq.
+class ClassVirtSpecifiers {
+public:
+ enum ClassVirtSpecifier {
+ CVS_None = 0,
+ CVS_Final = 1,
+ CVS_Explicit = 2
+ };
+
+ ClassVirtSpecifiers() : Specifiers(0) { }
+
+ bool isFinalSpecified() const { return Specifiers & CVS_Final; }
+ SourceLocation getFinalLoc() const { return CVS_finalLoc; }
+
+ bool isExplicitSpecified() const { return Specifiers & CVS_Explicit; }
+ SourceLocation getExplicitLoc() const { return CVS_explicitLoc; }
+
+private:
+ unsigned Specifiers;
+
+ SourceLocation CVS_finalLoc, CVS_explicitLoc;
+
+ static const char *getSpecifierName(ClassVirtSpecifier CVS);
+};
+
} // end namespace clang
#endif
Modified: cfe/trunk/lib/Sema/DeclSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/DeclSpec.cpp?rev=124032&r1=124031&r2=124032&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/DeclSpec.cpp (original)
+++ cfe/trunk/lib/Sema/DeclSpec.cpp Sat Jan 22 09:11:37 2011
@@ -669,15 +669,6 @@
}
}
-const char *VirtSpecifiers::getSpecifierName(VirtSpecifier VS) {
- switch (VS) {
- default: assert(0 && "Unknown specifier");
- case VS_Override: return "override";
- case VS_Final: return "final";
- case VS_New: return "new";
- }
-}
-
bool VirtSpecifiers::SetVirtSpecifier(VirtSpecifier VS, SourceLocation Loc,
const char *&PrevSpec) {
if (Specifiers & VS) {
@@ -696,3 +687,11 @@
return false;
}
+const char *VirtSpecifiers::getSpecifierName(VirtSpecifier VS) {
+ switch (VS) {
+ default: assert(0 && "Unknown specifier");
+ case VS_Override: return "override";
+ case VS_Final: return "final";
+ case VS_New: return "new";
+ }
+}
More information about the cfe-commits
mailing list