diff options
Diffstat (limited to 'clang/lib/Sema/DeclSpec.cpp')
-rw-r--r-- | clang/lib/Sema/DeclSpec.cpp | 80 |
1 files changed, 39 insertions, 41 deletions
diff --git a/clang/lib/Sema/DeclSpec.cpp b/clang/lib/Sema/DeclSpec.cpp index 460e7722c10..2fad5a18ba6 100644 --- a/clang/lib/Sema/DeclSpec.cpp +++ b/clang/lib/Sema/DeclSpec.cpp @@ -324,52 +324,51 @@ bool Declarator::isDeclarationOfFunction() const { } switch (DS.getTypeSpecType()) { - case TypeSpecifierType::TST_atomic: - case TypeSpecifierType::TST_auto: - case TypeSpecifierType::TST_auto_type: - case TypeSpecifierType::TST_bool: - case TypeSpecifierType::TST_char: - case TypeSpecifierType::TST_char16: - case TypeSpecifierType::TST_char32: - case TypeSpecifierType::TST_class: - case TypeSpecifierType::TST_decimal128: - case TypeSpecifierType::TST_decimal32: - case TypeSpecifierType::TST_decimal64: - case TypeSpecifierType::TST_double: - case TypeSpecifierType::TST_Float16: - case TypeSpecifierType::TST_float128: - case TypeSpecifierType::TST_enum: - case TypeSpecifierType::TST_error: - case TypeSpecifierType::TST_float: - case TypeSpecifierType::TST_half: - case TypeSpecifierType::TST_int: - case TypeSpecifierType::TST_int128: - case TypeSpecifierType::TST_struct: - case TypeSpecifierType::TST_interface: - case TypeSpecifierType::TST_union: - case TypeSpecifierType::TST_unknown_anytype: - case TypeSpecifierType::TST_unspecified: - case TypeSpecifierType::TST_void: - case TypeSpecifierType::TST_wchar: -#define GENERIC_IMAGE_TYPE(ImgType, Id) \ - case TypeSpecifierType::TST_##ImgType##_t: + case TST_atomic: + case TST_auto: + case TST_auto_type: + case TST_bool: + case TST_char: + case TST_char16: + case TST_char32: + case TST_class: + case TST_decimal128: + case TST_decimal32: + case TST_decimal64: + case TST_double: + case TST_Float16: + case TST_float128: + case TST_enum: + case TST_error: + case TST_float: + case TST_half: + case TST_int: + case TST_int128: + case TST_struct: + case TST_interface: + case TST_union: + case TST_unknown_anytype: + case TST_unspecified: + case TST_void: + case TST_wchar: +#define GENERIC_IMAGE_TYPE(ImgType, Id) case TST_##ImgType##_t: #include "clang/Basic/OpenCLImageTypes.def" return false; - case TypeSpecifierType::TST_decltype_auto: + case TST_decltype_auto: // This must have an initializer, so can't be a function declaration, // even if the initializer has function type. return false; - case TypeSpecifierType::TST_decltype: - case TypeSpecifierType::TST_typeofExpr: + case TST_decltype: + case TST_typeofExpr: if (Expr *E = DS.getRepAsExpr()) return E->getType()->isFunctionType(); return false; - case TypeSpecifierType::TST_underlyingType: - case TypeSpecifierType::TST_typename: - case TypeSpecifierType::TST_typeofType: { + case TST_underlyingType: + case TST_typename: + case TST_typeofType: { QualType QT = DS.getRepAsType().get(); if (QT.isNull()) return false; @@ -499,8 +498,7 @@ const char *DeclSpec::getSpecifierName(DeclSpec::TST T, case DeclSpec::TST_unspecified: return "unspecified"; case DeclSpec::TST_void: return "void"; case DeclSpec::TST_char: return "char"; - case DeclSpec::TST_wchar: - return Policy.MSWChar ? "__wchar_t" : "wchar_t"; + case DeclSpec::TST_wchar: return Policy.MSWChar ? "__wchar_t" : "wchar_t"; case DeclSpec::TST_char16: return "char16_t"; case DeclSpec::TST_char32: return "char32_t"; case DeclSpec::TST_int: return "int"; @@ -972,9 +970,9 @@ bool DeclSpec::SetConstexprSpec(SourceLocation Loc, const char *&PrevSpec, } void DeclSpec::SaveWrittenBuiltinSpecs() { - writtenBS.Sign = static_cast<unsigned char>(getTypeSpecSign()); - writtenBS.Width = static_cast<unsigned char>(getTypeSpecWidth()); - writtenBS.Type = static_cast<unsigned char>(getTypeSpecType()); + writtenBS.Sign = getTypeSpecSign(); + writtenBS.Width = getTypeSpecWidth(); + writtenBS.Type = getTypeSpecType(); // Search the list of attributes for the presence of a mode attribute. writtenBS.ModeAttr = false; AttributeList* attrs = getAttributes().getList(); @@ -1112,7 +1110,7 @@ void DeclSpec::Finish(Sema &S, const PrintingPolicy &Policy) { } // Validate the width of the type. - switch (static_cast<TypeSpecifierWidth>(TypeSpecWidth)) { + switch (TypeSpecWidth) { case TSW_unspecified: break; case TSW_short: // short int case TSW_longlong: // long long int |