Lines Matching +full:diag +full:- +full:version
1 //===--- SemaStmtAttr.cpp - Statement Attribute Handling ------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file implements stmt-related attribute processing.
11 //===----------------------------------------------------------------------===//
32 S.Diag(A.getRange().getBegin(), diag::err_fallthrough_attr_wrong_target) in handleFallThroughAttr()
33 << A << St->getBeginLoc(); in handleFallThroughAttr()
35 S.Diag(L, diag::note_fallthrough_insert_semi_fixit) in handleFallThroughAttr()
40 if (FnScope->SwitchStack.empty()) { in handleFallThroughAttr()
41 S.Diag(A.getRange().getBegin(), diag::err_fallthrough_attr_outside_switch); in handleFallThroughAttr()
49 S.Diag(A.getLoc(), diag::ext_cxx17_attr) << A; in handleFallThroughAttr()
51 FnScope->setHasFallthroughStmt(); in handleFallThroughAttr()
60 S.Diag(A.getLoc(), diag::err_attribute_too_few_arguments) << A << 1; in handleSuppressAttr()
86 llvm::StringSwitch<StringRef>(PragmaNameLoc->Ident->getName()) in handleLoopHintAttr()
88 PragmaNameLoc->Ident->getName()) in handleLoopHintAttr()
96 S.Diag(St->getBeginLoc(), diag::err_pragma_loop_precedes_nonloop) << Pragma; in handleLoopHintAttr()
114 if (!ValueExpr->isValueDependent()) { in handleLoopHintAttr()
115 auto Value = ValueExpr->EvaluateKnownConstInt(S.getASTContext()); in handleLoopHintAttr()
134 assert(OptionLoc && OptionLoc->Ident && in handleLoopHintAttr()
137 OptionLoc->Ident->getName()) in handleLoopHintAttr()
151 assert((ValueExpr || (StateLoc && StateLoc->Ident)) && in handleLoopHintAttr()
153 if (ValueExpr && S.CheckLoopHintExpr(ValueExpr, St->getBeginLoc(), in handleLoopHintAttr()
156 if (StateLoc && StateLoc->Ident && StateLoc->Ident->isStr("scalable")) in handleLoopHintAttr()
164 if (S.CheckLoopHintExpr(ValueExpr, St->getBeginLoc(), in handleLoopHintAttr()
174 assert(StateLoc && StateLoc->Ident && "Loop hint must have an argument"); in handleLoopHintAttr()
175 if (StateLoc->Ident->isStr("disable")) in handleLoopHintAttr()
177 else if (StateLoc->Ident->isStr("assume_safety")) in handleLoopHintAttr()
179 else if (StateLoc->Ident->isStr("full")) in handleLoopHintAttr()
181 else if (StateLoc->Ident->isStr("enable")) in handleLoopHintAttr()
225 S.Diag(St->getBeginLoc(), diag::warn_attribute_ignored_no_calls_in_stmt) in handleNoMergeAttr()
243 // version of the other. In this case, we will end up re-diagnosing in the in CheckStmtInlineAttr()
251 return SemaRef.Diag(CurSt->getBeginLoc(), in CheckStmtInlineAttr()
252 diag::warn_attribute_ignored_no_calls_in_stmt) in CheckStmtInlineAttr()
261 if (!CanSuppressDiag || !(*std::get<0>(Tup))->getCalleeDecl()) { in CheckStmtInlineAttr()
262 const Decl *Callee = (*std::get<1>(Tup))->getCalleeDecl(); in CheckStmtInlineAttr()
264 (Callee->hasAttr<OtherAttr>() || Callee->hasAttr<FlattenAttr>())) { in CheckStmtInlineAttr()
265 SemaRef.Diag(CurSt->getBeginLoc(), in CheckStmtInlineAttr()
266 diag::warn_function_stmt_attribute_precedence) in CheckStmtInlineAttr()
267 << A << (Callee->hasAttr<OtherAttr>() ? DiagIdx : 1); in CheckStmtInlineAttr()
268 SemaRef.Diag(Callee->getBeginLoc(), diag::note_conflicting_attribute); in CheckStmtInlineAttr()
290 S.Diag(St->getBeginLoc(), diag::warn_function_attribute_ignored_in_stmt) in handleNoInlineAttr()
305 S.Diag(St->getBeginLoc(), diag::warn_function_attribute_ignored_in_stmt) in handleAlwaysInlineAttr()
335 S.Diag(A.getLoc(), diag::ext_cxx20_attr) << A << Range; in handleLikely()
344 S.Diag(A.getLoc(), diag::ext_cxx20_attr) << A << Range; in handleUnlikely()
351 if (!E->isValueDependent()) { in BuildCodeAlignAttr()
363 Diag(CI.getLoc(), diag::err_attribute_power_of_two_in_range) in BuildCodeAlignAttr()
367 Diag(CI.getLoc(), diag::err_attribute_power_of_two_in_range) in BuildCodeAlignAttr()
382 // Diagnose non-identical duplicates as a 'conflicting' loop attributes
396 dyn_cast<ConstantExpr>(cast<LoopAttrT>(*FirstItr)->getAlignment()); in CheckForDuplicateLoopAttrs()
405 dyn_cast<ConstantExpr>(cast<LoopAttrT>(*LastFoundItr)->getAlignment()); in CheckForDuplicateLoopAttrs()
410 llvm::APSInt SecondValue = CASA->getResultAsAPSInt(); in CheckForDuplicateLoopAttrs()
412 FirstValue = CAFA->getResultAsAPSInt(); in CheckForDuplicateLoopAttrs()
415 S.Diag((*LastFoundItr)->getLocation(), diag::err_loop_attr_conflict) in CheckForDuplicateLoopAttrs()
417 S.Diag((*FirstItr)->getLocation(), diag::note_previous_attribute); in CheckForDuplicateLoopAttrs()
426 S.Diag(A.getLoc(), diag::warn_unknown_attribute_ignored) in handleMSConstexprAttr()
445 // First, check for the easy cases that are table-generated for us. in CheckForIncompatibleAttributes()
485 LoopHintAttr::OptionType Option = LH->getOption(); in CheckForIncompatibleAttributes()
535 SourceLocation OptionLoc = LH->getRange().getBegin(); in CheckForIncompatibleAttributes()
538 S.Diag(OptionLoc, diag::err_pragma_loop_compatibility) in CheckForIncompatibleAttributes()
539 << /*Duplicate=*/true << PrevAttr->getDiagnosticName(Policy) in CheckForIncompatibleAttributes()
540 << LH->getDiagnosticName(Policy); in CheckForIncompatibleAttributes()
544 CategoryState.StateAttr->getState() == LoopHintAttr::Disable)) { in CheckForIncompatibleAttributes()
549 S.Diag(OptionLoc, diag::err_pragma_loop_compatibility) in CheckForIncompatibleAttributes()
551 << CategoryState.StateAttr->getDiagnosticName(Policy) in CheckForIncompatibleAttributes()
552 << CategoryState.NumericAttr->getDiagnosticName(Policy); in CheckForIncompatibleAttributes()
569 if (!(ArgVal = E->getIntegerConstantExpr(S.Context))) { in handleOpenCLUnrollHint()
570 S.Diag(A.getLoc(), diag::err_attribute_argument_type) in handleOpenCLUnrollHint()
571 << A << AANT_ArgumentIntegerConstant << E->getSourceRange(); in handleOpenCLUnrollHint()
575 int Val = ArgVal->getSExtValue(); in handleOpenCLUnrollHint()
577 S.Diag(A.getRange().getBegin(), in handleOpenCLUnrollHint()
578 diag::err_attribute_requires_positive_integer) in handleOpenCLUnrollHint()
599 S.Diag(A.getLoc(), diag::err_attribute_argument_type) in handleHLSLLoopHintAttr()
606 if (S.CheckLoopHintExpr(E, St->getBeginLoc(), in handleHLSLLoopHintAttr()
610 std::optional<llvm::APSInt> ArgVal = E->getIntegerConstantExpr(S.Context); in handleHLSLLoopHintAttr()
613 int Val = ArgVal->getSExtValue(); in handleHLSLLoopHintAttr()
626 // Unknown attributes are automatically warned on. Target-specific attributes in ProcessStmtAttribute()
634 S.Diag(A.getLoc(), A.isRegularKeywordAttribute() in ProcessStmtAttribute()
635 ? (unsigned)diag::err_keyword_not_supported_on_target in ProcessStmtAttribute()
637 ? (unsigned)diag::warn_unhandled_ms_attribute_ignored in ProcessStmtAttribute()
638 : (unsigned)diag::warn_unknown_attribute_ignored) in ProcessStmtAttribute()
679 S.Diag(A.getRange().getBegin(), diag::err_decl_attribute_invalid_on_stmt) in ProcessStmtAttribute()
680 << A << A.isRegularKeywordAttribute() << St->getBeginLoc(); in ProcessStmtAttribute()
704 Diag(A.getLoc(), diag::err_attribute_wrong_number_arguments) in ActOnCXXAssumeAttr()
715 if (Assumption->getDependence() == ExprDependence::None) { in ActOnCXXAssumeAttr()
724 Diag(A.getLoc(), diag::ext_cxx23_attr) << A << Range; in ActOnCXXAssumeAttr()
745 if (Assumption->HasSideEffects(Context)) in BuildCXXAssumeExpr()
746 Diag(Assumption->getBeginLoc(), diag::warn_assume_side_effects) in BuildCXXAssumeExpr()