From: Steve Naroff Date: Thu, 14 Feb 2008 03:30:24 +0000 (+0000) Subject: Remove DeclSpec::Invalid, a recently added bool that allowed the parser to detect... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=96715ae0c6a88d6f40cdd6e1164a1308a15874ea;p=clang 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47104 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Parse/DeclSpec.cpp b/Parse/DeclSpec.cpp index 8f9a5fd791..1cd350893f 100644 --- a/Parse/DeclSpec.cpp +++ b/Parse/DeclSpec.cpp @@ -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; diff --git a/include/clang/Parse/DeclSpec.h b/include/clang/Parse/DeclSpec.h index e38f764af6..8c07f6f92f 100644 --- a/include/clang/Parse/DeclSpec.h +++ b/include/clang/Parse/DeclSpec.h @@ -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;