Start stubbing out a ClassVirtSpecifiers class.

llvm-svn: 124032
This commit is contained in:
Anders Carlsson 2011-01-22 15:11:37 +00:00
parent e973899f46
commit a6d35015c8
2 changed files with 34 additions and 10 deletions

View File

@ -1468,7 +1468,7 @@ struct FieldDeclarator {
}
};
///
/// VirtSpecifiers - Represents a C++0x virt-specifier-seq.
class VirtSpecifiers {
public:
enum VirtSpecifier {
@ -1501,6 +1501,31 @@ private:
};
/// 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

View File

@ -669,15 +669,6 @@ void UnqualifiedId::setOperatorFunctionId(SourceLocation OperatorLoc,
}
}
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 @@ bool VirtSpecifiers::SetVirtSpecifier(VirtSpecifier VS, SourceLocation Loc,
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";
}
}