Home | History | Annotate | Download | only in Sema

Lines Matching refs:DeclSpec

28 #include "clang/Sema/DeclSpec.h"
135 /// DeclSpec.
144 /// The original set of attributes on the DeclSpec.
184 /// Save the current set of attributes on the DeclSpec.
189 DeclSpec &spec = getMutableDeclSpec();
219 DeclSpec &getMutableDeclSpec() const {
220 return const_cast<DeclSpec&>(declarator.getDeclSpec());
690 /// \brief Convert the specified declspec to the appropriate type
697 // FIXME: Should move the logic from DeclSpec::Finish to here for validity
702 const DeclSpec &DS = declarator.getDeclSpec();
711 case DeclSpec::TST_void:
714 case DeclSpec::TST_char:
715 if (DS.getTypeSpecSign() == DeclSpec::TSS_unspecified)
717 else if (DS.getTypeSpecSign() == DeclSpec::TSS_signed)
720 assert(DS.getTypeSpecSign() == DeclSpec::TSS_unsigned &&
725 case DeclSpec::TST_wchar:
726 if (DS.getTypeSpecSign() == DeclSpec::TSS_unspecified)
728 else if (DS.getTypeSpecSign() == DeclSpec::TSS_signed) {
734 assert(DS.getTypeSpecSign() == DeclSpec::TSS_unsigned &&
742 case DeclSpec::TST_char16:
743 assert(DS.getTypeSpecSign() == DeclSpec::TSS_unspecified &&
747 case DeclSpec::TST_char32:
748 assert(DS.getTypeSpecSign() == DeclSpec::TSS_unspecified &&
752 case DeclSpec::TST_unspecified:
754 if (DeclSpec::ProtocolQualifierListTy PQ = DS.getProtocolQualifiers()) {
762 // If this is a missing declspec in a block literal return context, then it
764 // The declspec is always missing in a lambda expr context; it is either
781 // allowed to be completely missing a declspec. This is handled in the
785 // In C89 mode, we only warn if there is a completely missing declspec
812 case DeclSpec::TST_int: {
813 if (DS.getTypeSpecSign() != DeclSpec::TSS_unsigned) {
815 case DeclSpec::TSW_unspecified: Result = Context.IntTy; break;
816 case DeclSpec::TSW_short: Result = Context.ShortTy; break;
817 case DeclSpec::TSW_long: Result = Context.LongTy; break;
818 case DeclSpec::TSW_longlong:
834 case DeclSpec::TSW_unspecified: Result = Context.UnsignedIntTy; break;
835 case DeclSpec::TSW_short: Result = Context.UnsignedShortTy; break;
836 case DeclSpec::TSW_long: Result = Context.UnsignedLongTy; break;
837 case DeclSpec::TSW_longlong:
854 case DeclSpec::TST_int128:
857 if (DS.getTypeSpecSign() == DeclSpec::TSS_unsigned)
862 case DeclSpec::TST_half: Result = Context.HalfTy; break;
863 case DeclSpec::TST_float: Result = Context.FloatTy; break;
864 case DeclSpec::TST_double:
865 if (DS.getTypeSpecWidth() == DeclSpec::TSW_long)
875 case DeclSpec::TST_bool: Result = Context.BoolTy; break; // _Bool or bool
876 case DeclSpec::TST_decimal32: // _Decimal32
877 case DeclSpec::TST_decimal64: // _Decimal64
878 case DeclSpec::TST_decimal128: // _Decimal128
883 case DeclSpec::TST_class:
884 case DeclSpec::TST_enum:
885 case DeclSpec::TST_union:
886 case DeclSpec::TST_struct:
887 case DeclSpec::TST_interface: {
911 case DeclSpec::TST_typename: {
918 else if (DeclSpec::ProtocolQualifierListTy PQ
952 case DeclSpec::TST_typeofType:
962 case DeclSpec::TST_typeofExpr: {
973 case DeclSpec::TST_decltype: {
984 case DeclSpec::TST_underlyingType:
996 case DeclSpec::TST_auto:
1042 case DeclSpec::TST_decltype_auto:
1048 case DeclSpec::TST_unknown_anytype:
1052 case DeclSpec::TST_atomic:
1062 case DeclSpec::TST_error:
1069 if (DS.getTypeSpecComplex() == DeclSpec::TSC_complex) {
1085 if (DS.getTypeSpecComplex() == DeclSpec::TSC_imaginary)
1106 if (TypeQuals & DeclSpec::TQ_const)
1109 else if (TypeQuals & DeclSpec::TQ_volatile)
1113 assert((TypeQuals & (DeclSpec::TQ_restrict | DeclSpec::TQ_atomic)) &&
1128 if (DS.getTypeSpecType() == DeclSpec::TST_typename &&
1132 typedef std::pair<DeclSpec::TQ, SourceLocation> QualLoc;
1134 QualLoc(DeclSpec::TQ_const, DS.getConstSpecLoc()),
1135 QualLoc(DeclSpec::TQ_volatile, DS.getVolatileSpecLoc()),
1136 QualLoc(DeclSpec::TQ_atomic, DS.getAtomicSpecLoc())
1142 << DeclSpec::getSpecifierName(Quals[I].first) << Result
1154 if (TypeQuals & DeclSpec::TQ_const && Result.isConstQualified()) {
1159 if (TypeQuals & DeclSpec::TQ_volatile && Result.isVolatileQualified()) {
1188 Qualifiers Qs, const DeclSpec *DS) {
1226 unsigned CVRA, const DeclSpec *DS) {
1227 // Convert from DeclSpec::TQ to Qualifiers::TQ by just dropping TQ_atomic.
1228 unsigned CVR = CVRA & ~DeclSpec::TQ_atomic;
1238 if (CVRA & DeclSpec::TQ_atomic && !T->isAtomicType()) {
2006 { DeclSpec::TQ_const, "const", ConstQualLoc },
2007 { DeclSpec::TQ_volatile, "volatile", VolatileQualLoc },
2008 { DeclSpec::TQ_restrict, "restrict", RestrictQualLoc },
2009 { DeclSpec::TQ_atomic, "_Atomic", AtomicQualLoc }
2081 unsigned AtomicQual = RetTy->isAtomicType() ? DeclSpec::TQ_atomic : 0;
2115 // The TagDecl owned by the DeclSpec.
2179 && D.getDeclSpec().getTypeSpecType() == DeclSpec::TST_auto))
2183 if (D.getDeclSpec().getStorageClassSpec() == DeclSpec::SCS_static)
2229 if (D.getDeclSpec().getStorageClassSpec() == DeclSpec::SCS_typedef)
2261 D.getDeclSpec().getTypeSpecType() == DeclSpec::TST_decltype_auto;
2363 != DeclSpec::SCS_unspecified)
2472 D.getDeclSpec().getStorageClassSpec() != DeclSpec::SCS_typedef &&
2498 D.getDeclSpec().getStorageClassSpec() == DeclSpec::SCS_typedef ||
2702 D.getDeclSpec().getTypeSpecType() == DeclSpec::TST_auto
3107 D.getDeclSpec().getStorageClassSpec() != DeclSpec::SCS_static) &&
3475 const DeclSpec &DS;
3478 TypeSpecLocFiller(ASTContext &Context, const DeclSpec &DS)
3500 if (DS.getTypeSpecType() == DeclSpec::TST_unspecified) {
3550 assert(DS.getTypeSpecType() == DeclSpec::TST_typeofExpr);
3555 assert(DS.getTypeSpecType() == DeclSpec::TST_typeofType);
3565 assert(DS.getTypeSpecType() == DeclSpec::TST_underlyingType);
3628 if (DS.getTypeSpecType() == DeclSpec::TST_atomic) {
4039 // Don't accept an ownership attribute in the declspec if it would