diff options
author | Faisal Vali <faisalv@yahoo.com> | 2018-01-01 15:42:13 +0000 |
---|---|---|
committer | Faisal Vali <faisalv@yahoo.com> | 2018-01-01 15:42:13 +0000 |
commit | 9d3d610d0582353d28b16c1d3acbd20773a93ab7 (patch) | |
tree | b4fc18c9d9401b9247eb41dc5c73d1bf0ff75052 /lib/Parse/ParseDeclCXX.cpp | |
parent | 5f7f2c06ee10be2b2b9f53d61d12d06fb7be3ff6 (diff) |
[NFC] Modernize enums TypeSpecifierWidth, TypeSpecifierSign & TypeSpecifierType into scoped enums with underlying types.
- Since these enums are used as bit-fields - for the bit-fields to be interpreted as unsigned, the underlying type must be specified as unsigned.
Previous failed attempt - wherein I did not specify an underlying type - was the sum of:
https://reviews.llvm.org/rC321614
https://reviews.llvm.org/rC321615
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321622 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDeclCXX.cpp')
-rw-r--r-- | lib/Parse/ParseDeclCXX.cpp | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp index 68b73ca1d2..8953eef1d7 100644 --- a/lib/Parse/ParseDeclCXX.cpp +++ b/lib/Parse/ParseDeclCXX.cpp @@ -1011,10 +1011,12 @@ void Parser::AnnotateExistingDecltypeSpecifier(const DeclSpec& DS, PP.EnterToken(Tok); Tok.setKind(tok::annot_decltype); - setExprAnnotation(Tok, - DS.getTypeSpecType() == TST_decltype ? DS.getRepAsExpr() : - DS.getTypeSpecType() == TST_decltype_auto ? ExprResult() : - ExprError()); + setExprAnnotation(Tok, DS.getTypeSpecType() == TypeSpecifierType::TST_decltype + ? DS.getRepAsExpr() + : DS.getTypeSpecType() == + TypeSpecifierType::TST_decltype_auto + ? ExprResult() + : ExprError()); Tok.setAnnotationEndLoc(EndLoc); Tok.setLocation(StartLoc); PP.AnnotateCachedTokens(Tok); @@ -1194,8 +1196,8 @@ TypeResult Parser::ParseBaseTypeSpecifier(SourceLocation &BaseLoc, const char *PrevSpec = nullptr; unsigned DiagID; - DS.SetTypeSpecType(TST_typename, IdLoc, PrevSpec, DiagID, Type, - Actions.getASTContext().getPrintingPolicy()); + DS.SetTypeSpecType(TypeSpecifierType::TST_typename, IdLoc, PrevSpec, DiagID, + Type, Actions.getASTContext().getPrintingPolicy()); Declarator DeclaratorInfo(DS, DeclaratorContext::TypeNameContext); return Actions.ActOnTypeName(getCurScope(), DeclaratorInfo); @@ -2952,7 +2954,8 @@ ExprResult Parser::ParseCXXMemberInitializer(Decl *D, bool IsFunction, void Parser::SkipCXXMemberSpecification(SourceLocation RecordLoc, SourceLocation AttrFixitLoc, - unsigned TagType, Decl *TagDecl) { + TypeSpecifierType TagType, + Decl *TagDecl) { // Skip the optional 'final' keyword. if (getLangOpts().CPlusPlus && Tok.is(tok::identifier)) { assert(isCXX11FinalKeyword() && "not a class definition"); @@ -3104,11 +3107,12 @@ Parser::DeclGroupPtrTy Parser::ParseCXXClassMemberDeclarationWithPragmas( void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc, SourceLocation AttrFixitLoc, ParsedAttributesWithRange &Attrs, - unsigned TagType, Decl *TagDecl) { + TypeSpecifierType TagType, + Decl *TagDecl) { assert((TagType == DeclSpec::TST_struct || - TagType == DeclSpec::TST_interface || - TagType == DeclSpec::TST_union || - TagType == DeclSpec::TST_class) && "Invalid TagType!"); + TagType == DeclSpec::TST_interface || + TagType == DeclSpec::TST_union || TagType == DeclSpec::TST_class) && + "Invalid TagType!"); PrettyDeclStackTraceEntry CrashInfo(Actions, TagDecl, RecordLoc, "parsing struct/union/class body"); |