diff options
author | faisalv <faisalv@yahoo.com> | 2020-11-15 11:13:57 -0600 |
---|---|---|
committer | faisalv <faisalv@yahoo.com> | 2020-11-15 11:13:57 -0600 |
commit | e6aa06545b123292be283af7c414daead23cf9ab (patch) | |
tree | fdadd1f208b4119f25260b62d2e695ff13b2bd68 /clang/lib/Parse/ParseDecl.cpp | |
parent | dea31f135ceae6e860e6301f9bb66d3b3adb1357 (diff) | |
download | llvm-e6aa06545b123292be283af7c414daead23cf9ab.zip llvm-e6aa06545b123292be283af7c414daead23cf9ab.tar.gz llvm-e6aa06545b123292be283af7c414daead23cf9ab.tar.bz2 |
[NFC, Refactor] Modernize the TypeSpecifierWidth enum (Specifiers.h) to a scoped enum
Reviewed here: https://reviews.llvm.org/D91409 by Aaron.
Highlights of the review:
- avoid an underlying type for enums
- avoid enum bit fields (MSVC packing anomalies) and favor static_casts to unsigned bit-fields
Patch by Thorsten Schuett <schuett@gmail.com> w some minor fixes in SemaType.cpp where a couple asserts had to be repaired to deal with lack of implicit coversion to int.
Thanks Thorsten!
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 0a19c0b..22d38f0 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -3690,20 +3690,20 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, // type-specifier case tok::kw_short: - isInvalid = DS.SetTypeSpecWidth(DeclSpec::TSW_short, Loc, PrevSpec, + isInvalid = DS.SetTypeSpecWidth(TypeSpecifierWidth::Short, Loc, PrevSpec, DiagID, Policy); break; case tok::kw_long: - if (DS.getTypeSpecWidth() != DeclSpec::TSW_long) - isInvalid = DS.SetTypeSpecWidth(DeclSpec::TSW_long, Loc, PrevSpec, + if (DS.getTypeSpecWidth() != TypeSpecifierWidth::Long) + isInvalid = DS.SetTypeSpecWidth(TypeSpecifierWidth::Long, Loc, PrevSpec, DiagID, Policy); else - isInvalid = DS.SetTypeSpecWidth(DeclSpec::TSW_longlong, Loc, PrevSpec, - DiagID, Policy); + isInvalid = DS.SetTypeSpecWidth(TypeSpecifierWidth::LongLong, Loc, + PrevSpec, DiagID, Policy); break; case tok::kw___int64: - isInvalid = DS.SetTypeSpecWidth(DeclSpec::TSW_longlong, Loc, PrevSpec, - DiagID, Policy); + isInvalid = DS.SetTypeSpecWidth(TypeSpecifierWidth::LongLong, Loc, + PrevSpec, DiagID, Policy); break; case tok::kw_signed: isInvalid = DS.SetTypeSpecSign(DeclSpec::TSS_signed, Loc, PrevSpec, |