diff options
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r-- | lib/Sema/SemaType.cpp | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index 919faa0a3c..f1b00e38d7 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -505,7 +505,7 @@ static void distributeTypeAttrsFromDeclarator(TypeProcessingState &state, break; case AttributeList::AT_ns_returns_retained: - if (!state.getSema().getLangOptions().ObjCAutoRefCount) + if (!state.getSema().getLangOpts().ObjCAutoRefCount) break; // fallthrough @@ -656,7 +656,7 @@ static QualType ConvertDeclSpecToType(TypeProcessingState &state) { // allowed to be completely missing a declspec. This is handled in the // parser already though by it pretending to have seen an 'int' in this // case. - if (S.getLangOptions().ImplicitInt) { + if (S.getLangOpts().ImplicitInt) { // In C89 mode, we only warn if there is a completely missing declspec // when one is not allowed. if (DS.isEmpty()) { @@ -670,8 +670,8 @@ static QualType ConvertDeclSpecToType(TypeProcessingState &state) { // specifiers in each declaration, and in the specifier-qualifier list in // each struct declaration and type name." // FIXME: Does Microsoft really have the implicit int extension in C++? - if (S.getLangOptions().CPlusPlus && - !S.getLangOptions().MicrosoftExt) { + if (S.getLangOpts().CPlusPlus && + !S.getLangOpts().MicrosoftExt) { S.Diag(DeclLoc, diag::err_missing_type_specifier) << DS.getSourceRange(); @@ -696,9 +696,9 @@ static QualType ConvertDeclSpecToType(TypeProcessingState &state) { Result = Context.LongLongTy; // long long is a C99 feature. - if (!S.getLangOptions().C99) + if (!S.getLangOpts().C99) S.Diag(DS.getTypeSpecWidthLoc(), - S.getLangOptions().CPlusPlus0x ? + S.getLangOpts().CPlusPlus0x ? diag::warn_cxx98_compat_longlong : diag::ext_longlong); break; } @@ -711,9 +711,9 @@ static QualType ConvertDeclSpecToType(TypeProcessingState &state) { Result = Context.UnsignedLongLongTy; // long long is a C99 feature. - if (!S.getLangOptions().C99) + if (!S.getLangOpts().C99) S.Diag(DS.getTypeSpecWidthLoc(), - S.getLangOptions().CPlusPlus0x ? + S.getLangOpts().CPlusPlus0x ? diag::warn_cxx98_compat_longlong : diag::ext_longlong); break; } @@ -728,7 +728,7 @@ static QualType ConvertDeclSpecToType(TypeProcessingState &state) { else Result = Context.DoubleTy; - if (S.getLangOptions().OpenCL && !S.getOpenCLOptions().cl_khr_fp64) { + if (S.getLangOpts().OpenCL && !S.getOpenCLOptions().cl_khr_fp64) { S.Diag(DS.getTypeSpecTypeLoc(), diag::err_double_requires_fp64); declarator.setInvalidType(true); } @@ -881,7 +881,7 @@ static QualType ConvertDeclSpecToType(TypeProcessingState &state) { // Handle complex types. if (DS.getTypeSpecComplex() == DeclSpec::TSC_complex) { - if (S.getLangOptions().Freestanding) + if (S.getLangOpts().Freestanding) S.Diag(DS.getTypeSpecComplexLoc(), diag::ext_freestanding_complex); Result = Context.getComplexType(Result); } else if (DS.isTypeAltiVecVector()) { @@ -1108,7 +1108,7 @@ QualType Sema::BuildPointerType(QualType T, assert(!T->isObjCObjectType() && "Should build ObjCObjectPointerType"); // In ARC, it is forbidden to build pointers to unqualified pointers. - if (getLangOptions().ObjCAutoRefCount) + if (getLangOpts().ObjCAutoRefCount) T = inferARCLifetimeForPointee(*this, T, Loc, /*reference*/ false); // Build the pointer type. @@ -1165,7 +1165,7 @@ QualType Sema::BuildReferenceType(QualType T, bool SpelledAsLValue, } // In ARC, it is forbidden to build references to unqualified pointers. - if (getLangOptions().ObjCAutoRefCount) + if (getLangOpts().ObjCAutoRefCount) T = inferARCLifetimeForPointee(*this, T, Loc, /*reference*/ true); // Handle restrict on references. @@ -1207,7 +1207,7 @@ QualType Sema::BuildArrayType(QualType T, ArrayType::ArraySizeModifier ASM, SourceRange Brackets, DeclarationName Entity) { SourceLocation Loc = Brackets.getBegin(); - if (getLangOptions().CPlusPlus) { + if (getLangOpts().CPlusPlus) { // C++ [dcl.array]p1: // T is called the array element type; this type shall not be a reference // type, the (possibly cv-qualified) type void, a function type or an @@ -1277,7 +1277,7 @@ QualType Sema::BuildArrayType(QualType T, ArrayType::ArraySizeModifier ASM, // C99 6.7.5.2p1: The size expression shall have integer type. // C++11 allows contextual conversions to such types. - if (!getLangOptions().CPlusPlus0x && + if (!getLangOpts().CPlusPlus0x && ArraySize && !ArraySize->isTypeDependent() && !ArraySize->getType()->isIntegralOrUnscopedEnumerationType()) { Diag(ArraySize->getLocStart(), diag::err_array_size_non_int) @@ -1298,7 +1298,7 @@ QualType Sema::BuildArrayType(QualType T, ArrayType::ArraySizeModifier ASM, isArraySizeVLA(*this, ArraySize, ConstVal)) { // Even in C++11, don't allow contextual conversions in the array bound // of a VLA. - if (getLangOptions().CPlusPlus0x && + if (getLangOpts().CPlusPlus0x && !ArraySize->getType()->isIntegralOrUnscopedEnumerationType()) { Diag(ArraySize->getLocStart(), diag::err_array_size_non_int) << ArraySize->getType() << ArraySize->getSourceRange(); @@ -1349,7 +1349,7 @@ QualType Sema::BuildArrayType(QualType T, ArrayType::ArraySizeModifier ASM, T = Context.getConstantArrayType(T, ConstVal, ASM, Quals); } // If this is not C99, extwarn about VLA's and C99 array size modifiers. - if (!getLangOptions().C99) { + if (!getLangOpts().C99) { if (T->isVariableArrayType()) { // Prohibit the use of non-POD types in VLAs. QualType BaseT = Context.getBaseElementType(T); @@ -1370,7 +1370,7 @@ QualType Sema::BuildArrayType(QualType T, ArrayType::ArraySizeModifier ASM, Diag(Loc, diag::ext_vla); } else if (ASM != ArrayType::Normal || Quals != 0) Diag(Loc, - getLangOptions().CPlusPlus? diag::err_c99_array_usage_cxx + getLangOpts().CPlusPlus? diag::err_c99_array_usage_cxx : diag::ext_c99_array_usage) << ASM; } @@ -1792,7 +1792,7 @@ static QualType GetDeclSpecTypeForDeclarator(TypeProcessingState &state, // type (this is checked later) and we can skip this. In other languages // using auto, we need to check regardless. if (D.getDeclSpec().getTypeSpecType() == DeclSpec::TST_auto && - (!SemaRef.getLangOptions().CPlusPlus0x || !D.isFunctionDeclarator())) { + (!SemaRef.getLangOpts().CPlusPlus0x || !D.isFunctionDeclarator())) { int Error = -1; switch (D.getContext()) { @@ -1854,7 +1854,7 @@ static QualType GetDeclSpecTypeForDeclarator(TypeProcessingState &state, // contains a trailing return type. That is only legal at the outermost // level. Check all declarator chunks (outermost first) anyway, to give // better diagnostics. - if (SemaRef.getLangOptions().CPlusPlus0x && Error != -1) { + if (SemaRef.getLangOpts().CPlusPlus0x && Error != -1) { for (unsigned i = 0, e = D.getNumTypeObjects(); i != e; ++i) { unsigned chunkIndex = e - i - 1; state.setCurrentChunkIndex(chunkIndex); @@ -1880,7 +1880,7 @@ static QualType GetDeclSpecTypeForDeclarator(TypeProcessingState &state, diag::warn_cxx98_compat_auto_type_specifier); } - if (SemaRef.getLangOptions().CPlusPlus && + if (SemaRef.getLangOpts().CPlusPlus && OwnedTagDecl && OwnedTagDecl->isCompleteDefinition()) { // Check the contexts where C++ forbids the declaration of a new class // or enumeration in a type-specifier-seq. @@ -2003,7 +2003,7 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state, Declarator &D = state.getDeclarator(); Sema &S = state.getSema(); ASTContext &Context = S.Context; - const LangOptions &LangOpts = S.getLangOptions(); + const LangOptions &LangOpts = S.getLangOpts(); bool ImplicitlyNoexcept = false; if (D.getName().getKind() == UnqualifiedId::IK_OperatorFunctionId && @@ -2639,7 +2639,7 @@ TypeSourceInfo *Sema::GetTypeForDeclarator(Declarator &D, Scope *S) { if (T.isNull()) return Context.getNullTypeSourceInfo(); - if (D.isPrototypeContext() && getLangOptions().ObjCAutoRefCount) + if (D.isPrototypeContext() && getLangOpts().ObjCAutoRefCount) inferARCWriteback(state, T); return GetFullTypeForDeclarator(state, T, ReturnTypeInfo); @@ -2750,7 +2750,7 @@ TypeSourceInfo *Sema::GetTypeForDeclaratorCast(Declarator &D, QualType FromTy) { if (declSpecTy.isNull()) return Context.getNullTypeSourceInfo(); - if (getLangOptions().ObjCAutoRefCount) { + if (getLangOpts().ObjCAutoRefCount) { Qualifiers::ObjCLifetime ownership = Context.getInnerObjCOwnership(FromTy); if (ownership != Qualifiers::OCL_None) transferARCOwnership(state, declSpecTy, ownership); @@ -3171,7 +3171,7 @@ TypeResult Sema::ActOnTypeName(Scope *S, Declarator &D) { if (D.getContext() != Declarator::ObjCParameterContext) checkUnusedDeclAttributes(D); - if (getLangOptions().CPlusPlus) { + if (getLangOpts().CPlusPlus) { // Check that there are no default arguments (C++ only). CheckExtraCXXDefaultArguments(D); } @@ -3319,7 +3319,7 @@ static bool handleObjCOwnershipTypeAttr(TypeProcessingState &state, // Consume lifetime attributes without further comment outside of // ARC mode. - if (!S.getLangOptions().ObjCAutoRefCount) + if (!S.getLangOpts().ObjCAutoRefCount) return true; Qualifiers::ObjCLifetime lifetime; @@ -3390,7 +3390,7 @@ static bool handleObjCOwnershipTypeAttr(TypeProcessingState &state, // Forbid __weak if the runtime doesn't support it. if (lifetime == Qualifiers::OCL_Weak && - !S.getLangOptions().ObjCRuntimeHasWeak && !NonObjCPointer) { + !S.getLangOpts().ObjCRuntimeHasWeak && !NonObjCPointer) { // Actually, delay this until we know what we're parsing. if (S.DelayedDiagnostics.shouldDelayDiagnostics()) { @@ -3637,7 +3637,7 @@ static bool handleFunctionTypeAttr(TypeProcessingState &state, // ns_returns_retained is not always a type attribute, but if we got // here, we're treating it as one right now. if (attr.getKind() == AttributeList::AT_ns_returns_retained) { - assert(S.getLangOptions().ObjCAutoRefCount && + assert(S.getLangOpts().ObjCAutoRefCount && "ns_returns_retained treated as type attribute in non-ARC"); if (attr.getNumArgs()) return true; @@ -3980,7 +3980,7 @@ static void processTypeAttrs(TypeProcessingState &state, QualType &type, break; case AttributeList::AT_ns_returns_retained: - if (!state.getSema().getLangOptions().ObjCAutoRefCount) + if (!state.getSema().getLangOpts().ObjCAutoRefCount) break; // fallthrough into the function attrs |