Remove DeclSpec::Invalid, a recently added bool that allowed the parser to detect if the decl spec was invalid.

For now, we will stick with the original strategy - clients of Parse::ParseDeclarationSpecifiers() should never have to know this.

llvm-svn: 47104
This commit is contained in:
Steve Naroff 2008-02-14 03:30:24 +00:00
parent f631997cb5
commit 2d868f2bcd
2 changed files with 1 additions and 12 deletions

View File

@ -48,13 +48,11 @@ const char *DeclSpec::getSpecifierName(DeclSpec::SCS S) {
}
bool DeclSpec::BadSpecifier(SCS S, const char *&PrevSpec) {
Invalid = true;
PrevSpec = getSpecifierName(S);
return true;
}
bool DeclSpec::BadSpecifier(TSW W, const char *&PrevSpec) {
Invalid = true;
switch (W) {
case TSW_unspecified: PrevSpec = "unspecified"; break;
case TSW_short: PrevSpec = "short"; break;
@ -65,7 +63,6 @@ bool DeclSpec::BadSpecifier(TSW W, const char *&PrevSpec) {
}
bool DeclSpec::BadSpecifier(TSC C, const char *&PrevSpec) {
Invalid = true;
switch (C) {
case TSC_unspecified: PrevSpec = "unspecified"; break;
case TSC_imaginary: PrevSpec = "imaginary"; break;
@ -76,7 +73,6 @@ bool DeclSpec::BadSpecifier(TSC C, const char *&PrevSpec) {
bool DeclSpec::BadSpecifier(TSS S, const char *&PrevSpec) {
Invalid = true;
switch (S) {
case TSS_unspecified: PrevSpec = "unspecified"; break;
case TSS_signed: PrevSpec = "signed"; break;
@ -108,13 +104,11 @@ const char *DeclSpec::getSpecifierName(DeclSpec::TST T) {
}
bool DeclSpec::BadSpecifier(TST T, const char *&PrevSpec) {
Invalid = true;
PrevSpec = getSpecifierName(T);
return true;
}
bool DeclSpec::BadSpecifier(TQ T, const char *&PrevSpec) {
Invalid = true;
switch (T) {
case DeclSpec::TQ_unspecified: PrevSpec = "unspecified"; break;
case DeclSpec::TQ_const: PrevSpec = "const"; break;

View File

@ -135,8 +135,6 @@ private:
SourceLocation TQ_constLoc, TQ_restrictLoc, TQ_volatileLoc;
SourceLocation FS_inlineLoc;
bool Invalid;
bool BadSpecifier(TST T, const char *&PrevSpec);
bool BadSpecifier(TQ T, const char *&PrevSpec);
bool BadSpecifier(TSS T, const char *&PrevSpec);
@ -156,8 +154,7 @@ public:
FS_inline_specified(false),
TypeRep(0),
AttrList(0),
ProtocolQualifiers(0),
Invalid(false) {
ProtocolQualifiers(0) {
}
~DeclSpec() {
delete AttrList;
@ -170,8 +167,6 @@ public:
SourceLocation getStorageClassSpecLoc() const { return StorageClassSpecLoc; }
SourceLocation getThreadSpecLoc() const { return SCS_threadLoc; }
bool isInvalid() { return Invalid; }
void ClearStorageClassSpecs() {
StorageClassSpec = DeclSpec::SCS_unspecified;
SCS_thread_specified = false;