31 S.
Diag(L, diag::note_fallthrough_insert_semi_fixit)
36 if (FnScope->SwitchStack.empty()) {
46 Sc = Sc->getParent()) {
47 if (Sc->isExpansionStmtScope()) {
48 S.
Diag(A.
getLoc(), diag::err_fallthrough_attr_invalid_placement);
59 FnScope->setHasFallthroughStmt();
68 S.
Diag(A.
getLoc(), diag::err_attribute_too_few_arguments) << A << 1;
72 std::vector<StringRef> DiagnosticIdentifiers;
73 for (
unsigned I = 0, E = A.
getNumArgs(); I != E; ++I) {
79 DiagnosticIdentifiers.push_back(RuleName);
82 return ::new (S.
Context) SuppressAttr(
83 S.
Context, A, DiagnosticIdentifiers.data(), DiagnosticIdentifiers.size());
93 StringRef PragmaName =
94 llvm::StringSwitch<StringRef>(
96 .Cases({
"unroll",
"nounroll",
"unroll_and_jam",
"nounroll_and_jam"},
98 .Default(
"clang loop");
104 std::string Pragma =
"#pragma " + std::string(PragmaName);
105 S.
Diag(St->
getBeginLoc(), diag::err_pragma_loop_precedes_nonloop) << Pragma;
109 LoopHintAttr::OptionType Option;
110 LoopHintAttr::LoopHintState State;
112 auto SetHints = [&Option, &State](LoopHintAttr::OptionType O,
113 LoopHintAttr::LoopHintState S) {
118 if (PragmaName ==
"nounroll") {
119 SetHints(LoopHintAttr::Unroll, LoopHintAttr::Disable);
120 }
else if (PragmaName ==
"unroll") {
126 SetHints(LoopHintAttr::Unroll, LoopHintAttr::Disable);
128 SetHints(LoopHintAttr::UnrollCount, LoopHintAttr::Numeric);
130 SetHints(LoopHintAttr::UnrollCount, LoopHintAttr::Numeric);
132 SetHints(LoopHintAttr::Unroll, LoopHintAttr::Enable);
133 }
else if (PragmaName ==
"nounroll_and_jam") {
134 SetHints(LoopHintAttr::UnrollAndJam, LoopHintAttr::Disable);
135 }
else if (PragmaName ==
"unroll_and_jam") {
138 SetHints(LoopHintAttr::UnrollAndJamCount, LoopHintAttr::Numeric);
140 SetHints(LoopHintAttr::UnrollAndJam, LoopHintAttr::Enable);
144 "Attribute must have valid option info.");
145 Option = llvm::StringSwitch<LoopHintAttr::OptionType>(
147 .Case(
"vectorize", LoopHintAttr::Vectorize)
148 .Case(
"vectorize_width", LoopHintAttr::VectorizeWidth)
149 .Case(
"interleave", LoopHintAttr::Interleave)
150 .Case(
"vectorize_predicate", LoopHintAttr::VectorizePredicate)
151 .Case(
"interleave_count", LoopHintAttr::InterleaveCount)
152 .Case(
"unroll", LoopHintAttr::Unroll)
153 .Case(
"unroll_count", LoopHintAttr::UnrollCount)
154 .Case(
"pipeline", LoopHintAttr::PipelineDisabled)
155 .Case(
"pipeline_initiation_interval",
156 LoopHintAttr::PipelineInitiationInterval)
157 .Case(
"distribute", LoopHintAttr::Distribute)
158 .Case(
"licm", LoopHintAttr::LICMDisabled)
159 .Default(LoopHintAttr::Vectorize);
160 if (Option == LoopHintAttr::VectorizeWidth) {
162 "Attribute must have a valid value expression or argument.");
168 State = LoopHintAttr::ScalableWidth;
170 State = LoopHintAttr::FixedWidth;
171 }
else if (Option == LoopHintAttr::InterleaveCount ||
172 Option == LoopHintAttr::UnrollCount ||
173 Option == LoopHintAttr::PipelineInitiationInterval) {
174 assert(ValueExpr &&
"Attribute must have a valid value expression.");
178 State = LoopHintAttr::Numeric;
179 }
else if (Option == LoopHintAttr::Vectorize ||
180 Option == LoopHintAttr::Interleave ||
181 Option == LoopHintAttr::VectorizePredicate ||
182 Option == LoopHintAttr::Unroll ||
183 Option == LoopHintAttr::Distribute ||
184 Option == LoopHintAttr::PipelineDisabled ||
185 Option == LoopHintAttr::LICMDisabled) {
187 "Loop hint must have an argument");
189 State = LoopHintAttr::Disable;
191 State = LoopHintAttr::AssumeSafety;
193 State = LoopHintAttr::Full;
195 State = LoopHintAttr::Enable;
197 llvm_unreachable(
"bad loop hint argument");
199 llvm_unreachable(
"bad loop hint");
202 return LoopHintAttr::CreateImplicit(S.
Context, Option, State, ValueExpr, A);
207 bool FoundAsmStmt =
false;
208 std::vector<const CallExpr *> CallExprs;
211 typedef ConstEvaluatedExprVisitor<CallExprFinder> Inherited;
213 CallExprFinder(Sema &S,
const Stmt *St) : Inherited(S.Context) { Visit(St); }
215 bool foundCallExpr() {
return !CallExprs.empty(); }
216 const std::vector<const CallExpr *> &getCallExprs() {
return CallExprs; }
218 bool foundAsmStmt() {
return FoundAsmStmt; }
220 void VisitCallExpr(
const CallExpr *E) { CallExprs.push_back(E); }
222 void VisitAsmStmt(
const AsmStmt *S) { FoundAsmStmt =
true; }
224 void Visit(
const Stmt *St) {
227 ConstEvaluatedExprVisitor<CallExprFinder>::Visit(St);
234 CallExprFinder CEF(S, St);
236 if (!CEF.foundCallExpr() && !CEF.foundAsmStmt()) {
237 S.
Diag(St->
getBeginLoc(), diag::warn_attribute_ignored_no_calls_in_stmt)
247 CallExprFinder CEF(S, St);
249 if (!CEF.foundCallExpr() && !CEF.foundAsmStmt()) {
250 S.
Diag(St->
getBeginLoc(), diag::warn_attribute_ignored_no_calls_in_stmt)
258template <
typename OtherAttr,
int DiagIdx>
262 CallExprFinder OrigCEF(SemaRef, OrigSt);
263 CallExprFinder CEF(SemaRef, CurSt);
272 bool CanSuppressDiag =
273 OrigSt && CEF.getCallExprs().size() == OrigCEF.getCallExprs().size();
275 if (!CEF.foundCallExpr()) {
277 diag::warn_attribute_ignored_no_calls_in_stmt)
281 for (
const auto &Tup :
282 llvm::zip_longest(OrigCEF.getCallExprs(), CEF.getCallExprs())) {
286 if (!CanSuppressDiag || !(*std::get<0>(Tup))->getCalleeDecl()) {
287 const Decl *Callee = (*std::get<1>(Tup))->getCalleeDecl();
289 (Callee->hasAttr<OtherAttr>() || Callee->hasAttr<FlattenAttr>())) {
291 diag::warn_function_stmt_attribute_precedence)
292 << A << (Callee->hasAttr<OtherAttr>() ? DiagIdx : 1);
293 SemaRef.
Diag(Callee->getBeginLoc(), diag::note_conflicting_attribute);
313 NoInlineAttr NIA(S.
Context, A);
314 if (!NIA.isStmtNoInline()) {
315 S.
Diag(St->
getBeginLoc(), diag::warn_function_attribute_ignored_in_stmt)
316 <<
"[[clang::noinline]]";
328 AlwaysInlineAttr AIA(S.
Context, A);
330 (AIA.isMSVCForceInline() || AIA.isMSVCForceInlineCalls())) {
334 if (AIA.isMSVCForceInline()) {
335 S.
Diag(St->
getBeginLoc(), diag::warn_function_attribute_ignored_in_stmt)
336 <<
"[[msvc::forceinline_calls]]";
339 if (!AIA.isClangAlwaysInline() && !AIA.isMSVCForceInlineCalls()) {
340 S.
Diag(St->
getBeginLoc(), diag::warn_function_attribute_ignored_in_stmt)
341 <<
"[[clang::always_inline]]";
375 if (
const auto *BO = dyn_cast<BinaryOperator>(E)) {
376 if (BO->getLHS()->getType()->isAtomicType())
383 if (
const auto *CE = dyn_cast<CallExpr>(E)) {
384 switch (CE->getBuiltinCallee()) {
385 case Builtin::BI__c11_atomic_thread_fence:
386 case Builtin::BI__c11_atomic_signal_fence:
387 case Builtin::BI__atomic_thread_fence:
388 case Builtin::BI__atomic_signal_fence:
389 case Builtin::BI__scoped_atomic_thread_fence:
406 if (Mode !=
"none") {
407 S.
Diag(A.
getLoc(), diag::warn_attribute_type_not_supported) << A << Mode;
411 if (
const auto *E = dyn_cast<Expr>(St)) {
413 S.
Diag(A.
getLoc(), diag::warn_amdgpu_av_requires_atomic) << A;
417 S.
Diag(A.
getLoc(), diag::warn_amdgpu_av_requires_expr) << A;
421 return ::new (S.
Context) AMDGPUAvailableVisibleAttr(S.
Context, A, Mode);
428 S.
Diag(A.
getLoc(), diag::ext_cxx20_attr) << A << Range;
437 S.
Diag(A.
getLoc(), diag::ext_cxx20_attr) << A << Range;
453 if (ArgVal < CodeAlignAttr::MinimumAlignment ||
454 ArgVal > CodeAlignAttr::MaximumAlignment || !ArgVal.isPowerOf2()) {
455 if (std::optional<int64_t>
Value = ArgVal.trySExtValue())
456 Diag(CI.
getLoc(), diag::err_attribute_power_of_two_in_range)
457 << CI << CodeAlignAttr::MinimumAlignment
458 << CodeAlignAttr::MaximumAlignment <<
Value.value();
460 Diag(CI.
getLoc(), diag::err_attribute_power_of_two_in_range)
461 << CI << CodeAlignAttr::MinimumAlignment
462 << CodeAlignAttr::MaximumAlignment << E;
477template <
typename LoopAttrT>
480 const auto *FirstItr = llvm::find_if(Attrs, FindFunc);
482 if (FirstItr == Attrs.end())
485 const auto *LastFoundItr = FirstItr;
486 std::optional<llvm::APSInt> FirstValue;
495 while (Attrs.end() != (LastFoundItr = std::find_if(LastFoundItr + 1,
496 Attrs.end(), FindFunc))) {
498 dyn_cast<ConstantExpr>(
cast<LoopAttrT>(*LastFoundItr)->getAlignment());
503 llvm::APSInt SecondValue = CASA->getResultAsAPSInt();
505 FirstValue = CAFA->getResultAsAPSInt();
507 if (llvm::APSInt::isSameValue(*FirstValue, SecondValue))
510 S.
Diag((*LastFoundItr)->getLocation(), diag::err_loop_attr_conflict)
512 S.
Diag((*FirstItr)->getLocation(), diag::note_previous_attribute);
519 S.
Diag(A.
getLoc(), diag::warn_unknown_attribute_ignored)
526#define WANT_STMT_MERGE_LOGIC
527#include "clang/Sema/AttrParsedAttrImpl.inc"
528#undef WANT_STMT_MERGE_LOGIC
535 if (Attrs.size() < 2)
539 if (!DiagnoseMutualExclusions(S, Attrs))
569 const LoopHintAttr *StateAttr;
570 const LoopHintAttr *NumericAttr;
571 } HintAttrs[CategoryType::NumberOfCategories] = {};
573 for (
const auto *I : Attrs) {
574 const LoopHintAttr *LH = dyn_cast<LoopHintAttr>(I);
580 CategoryType Category = CategoryType::NumberOfCategories;
581 LoopHintAttr::OptionType Option = LH->getOption();
583 case LoopHintAttr::Vectorize:
584 case LoopHintAttr::VectorizeWidth:
585 Category = Vectorize;
587 case LoopHintAttr::Interleave:
588 case LoopHintAttr::InterleaveCount:
589 Category = Interleave;
591 case LoopHintAttr::Unroll:
592 case LoopHintAttr::UnrollCount:
595 case LoopHintAttr::UnrollAndJam:
596 case LoopHintAttr::UnrollAndJamCount:
597 Category = UnrollAndJam;
599 case LoopHintAttr::Distribute:
601 Category = Distribute;
603 case LoopHintAttr::PipelineDisabled:
604 case LoopHintAttr::PipelineInitiationInterval:
607 case LoopHintAttr::VectorizePredicate:
608 Category = VectorizePredicate;
610 case LoopHintAttr::LICMDisabled:
615 assert(Category != NumberOfCategories &&
"Unhandled loop hint option");
616 auto &CategoryState = HintAttrs[Category];
617 const LoopHintAttr *PrevAttr;
618 if (Option == LoopHintAttr::Vectorize ||
619 Option == LoopHintAttr::Interleave || Option == LoopHintAttr::Unroll ||
620 Option == LoopHintAttr::UnrollAndJam ||
621 Option == LoopHintAttr::VectorizePredicate ||
622 Option == LoopHintAttr::PipelineDisabled ||
623 Option == LoopHintAttr::LICMDisabled ||
624 Option == LoopHintAttr::Distribute) {
626 PrevAttr = CategoryState.StateAttr;
627 CategoryState.StateAttr = LH;
630 PrevAttr = CategoryState.NumericAttr;
631 CategoryState.NumericAttr = LH;
638 S.
Diag(OptionLoc, diag::err_pragma_loop_compatibility)
639 <<
true << PrevAttr->getDiagnosticName(Policy)
640 << LH->getDiagnosticName(Policy);
642 if (CategoryState.StateAttr && CategoryState.NumericAttr &&
643 (Category == Unroll || Category == UnrollAndJam ||
644 CategoryState.StateAttr->getState() == LoopHintAttr::Disable)) {
649 S.
Diag(OptionLoc, diag::err_pragma_loop_compatibility)
651 << CategoryState.StateAttr->getDiagnosticName(Policy)
652 << CategoryState.NumericAttr->getDiagnosticName(Policy);
664 unsigned UnrollFactor = 0;
667 std::optional<llvm::APSInt> ArgVal;
670 S.
Diag(A.
getLoc(), diag::err_attribute_argument_type)
675 int Val = ArgVal->getSExtValue();
678 diag::err_attribute_requires_positive_integer)
682 UnrollFactor =
static_cast<unsigned>(Val);
685 return ::new (S.
Context) OpenCLUnrollHintAttr(S.
Context, A, UnrollFactor);
695 unsigned UnrollFactor = 0;
705 assert(ArgVal != std::nullopt &&
"ArgVal should be an integer constant.");
706 int Val = ArgVal->getSExtValue();
708 assert(Val > 0 &&
"Val should be a positive integer greater than zero.");
709 UnrollFactor =
static_cast<unsigned>(Val);
711 return ::new (S.
Context) HLSLLoopHintAttr(S.
Context, A, UnrollFactor);
726 for (
unsigned ArgIndex = 0; ArgIndex < AL.
getNumArgs(); ++ArgIndex) {
727 AtomicAttr::ConsumedOption Option;
728 StringRef OptionString;
733 diag::err_attribute_argument_type)
741 if (!AtomicAttr::ConvertStrToConsumedOption(OptionString, Option)) {
742 S.
Diag(Loc, diag::err_attribute_invalid_atomic_argument) << OptionString;
745 Options.push_back(Option);
749 AtomicAttr(S.
Context, AL, Options.data(), Options.size());
766 S.
Diag(A.
getLoc(), diag::err_keyword_not_supported_on_target)
769 S.
Diag(A.
getLoc(), diag::warn_unhandled_ms_attribute_ignored)
781 case ParsedAttr::AT_AlwaysInline:
783 case ParsedAttr::AT_CXXAssume:
785 case ParsedAttr::AT_FallThrough:
787 case ParsedAttr::AT_LoopHint:
789 case ParsedAttr::AT_HLSLLoopHint:
791 case ParsedAttr::AT_HLSLControlFlowHint:
793 case ParsedAttr::AT_OpenCLUnrollHint:
795 case ParsedAttr::AT_Suppress:
797 case ParsedAttr::AT_NoMerge:
799 case ParsedAttr::AT_NoInline:
801 case ParsedAttr::AT_MustTail:
803 case ParsedAttr::AT_AMDGPUAvailableVisible:
805 case ParsedAttr::AT_Likely:
807 case ParsedAttr::AT_Unlikely:
809 case ParsedAttr::AT_CodeAlign:
811 case ParsedAttr::AT_MSConstexpr:
813 case ParsedAttr::AT_NoConvergent:
815 case ParsedAttr::AT_Annotate:
817 case ParsedAttr::AT_Atomic:
820 if (
Attr *AT =
nullptr; A.
getInfo().handleStmtAttribute(S, St, A, AT) !=
837 OutAttrs.push_back(A);
852 Diag(A.
getLoc(), diag::err_attribute_wrong_number_arguments)
863 if (Assumption->getDependence() == ExprDependence::None) {
867 Assumption = Res.
get();
872 Diag(A.
getLoc(), diag::ext_cxx23_attr) << A << Range;
895 Assumption = Res.
get();
898 << AttrName << Range;
Defines the clang::ASTContext interface.
Defines the classes clang::DelayedDiagnostic and clang::AccessedEntity.
static void handleNoMergeAttr(Sema &S, Decl *D, const ParsedAttr &AL)
static void handleAlwaysInlineAttr(Sema &S, Decl *D, const ParsedAttr &AL)
static void handleMSConstexprAttr(Sema &S, Decl *D, const ParsedAttr &AL)
static void handleSuppressAttr(Sema &S, Decl *D, const ParsedAttr &AL)
static Attr * handleNoConvergentAttr(Sema &S, Stmt *St, const ParsedAttr &A, SourceRange Range)
static void CheckForDuplicateLoopAttrs(Sema &S, ArrayRef< const Attr * > Attrs)
static Attr * handleMustTailAttr(Sema &S, Stmt *St, const ParsedAttr &A, SourceRange Range)
static Attr * handleCXXAssumeAttr(Sema &S, Stmt *St, const ParsedAttr &A, SourceRange Range)
static Attr * ProcessStmtAttribute(Sema &S, Stmt *St, const ParsedAttr &A, SourceRange Range)
static Attr * handleAMDGPUAvailableVisibleAttr(Sema &S, Stmt *St, const ParsedAttr &A, SourceRange Range)
static Attr * handleLikely(Sema &S, Stmt *St, const ParsedAttr &A, SourceRange Range)
static Attr * handleNoMergeAttr(Sema &S, Stmt *St, const ParsedAttr &A, SourceRange Range)
static Attr * handleOpenCLUnrollHint(Sema &S, Stmt *St, const ParsedAttr &A, SourceRange Range)
static Attr * handleLoopHintAttr(Sema &S, Stmt *St, const ParsedAttr &A, SourceRange)
static Attr * handleAtomicAttr(Sema &S, Stmt *St, const ParsedAttr &AL, SourceRange Range)
static void CheckForIncompatibleAttributes(Sema &S, const SmallVectorImpl< const Attr * > &Attrs)
static Attr * handleHLSLControlFlowHint(Sema &S, Stmt *St, const ParsedAttr &A, SourceRange Range)
static bool CheckStmtInlineAttr(Sema &SemaRef, const Stmt *OrigSt, const Stmt *CurSt, const AttributeCommonInfo &A)
static Attr * handleHLSLLoopHintAttr(Sema &S, Stmt *St, const ParsedAttr &A, SourceRange Range)
static Attr * handleCodeAlignAttr(Sema &S, Stmt *St, const ParsedAttr &A)
static bool isAtomicExprOrFence(const Expr *E)
Return true if E is an atomic expression or a fence.
static Attr * handleFallThroughAttr(Sema &S, Stmt *St, const ParsedAttr &A, SourceRange Range)
static Attr * handleSuppressAttr(Sema &S, Stmt *St, const ParsedAttr &A, SourceRange Range)
static Attr * handleUnlikely(Sema &S, Stmt *St, const ParsedAttr &A, SourceRange Range)
static Attr * handleNoInlineAttr(Sema &S, Stmt *St, const ParsedAttr &A, SourceRange Range)
const LangOptions & getLangOpts() const
const TargetInfo * getAuxTargetInfo() const
const TargetInfo & getTargetInfo() const
Attr - This represents one attribute.
bool isCXX11Attribute() const
bool isDeclspecAttribute() const
SourceRange getRange() const
unsigned getAttributeSpellingListIndex() const
const IdentifierInfo * getScopeName() const
bool isRegularKeywordAttribute() const
SourceLocation getLoc() const
const IdentifierInfo * getAttrName() const
ConstEvaluatedExprVisitor - This class visits 'const Expr *'s.
Decl - This represents one declaration (or definition), e.g.
This represents one expression.
Expr * IgnoreParenCasts() LLVM_READONLY
Skip past any parentheses and casts which might surround this expression until reaching a fixed point...
bool isValueDependent() const
Determines whether the value of this expression depends on.
llvm::APSInt EvaluateKnownConstInt(const ASTContext &Ctx) const
EvaluateKnownConstInt - Call EvaluateAsRValue and return the folded integer.
bool HasSideEffects(const ASTContext &Ctx, bool IncludePossibleEffects=true) const
HasSideEffects - This routine returns true for all those expressions which have any effect other than...
std::optional< llvm::APSInt > getIntegerConstantExpr(const ASTContext &Ctx, bool AllowRelaxedEval=false) const
isIntegerConstantExpr - Return the value if this expression is a valid integer constant expression.
static FixItHint CreateInsertion(SourceLocation InsertionLoc, StringRef Code, bool BeforePreviousInsertions=false)
Create a code modification hint that inserts the given code string at a specific location.
One of these records is kept for each identifier that is lexed.
bool isStr(const char(&Str)[StrLen]) const
Return true if this is the identifier for the specified string.
StringRef getName() const
Return the actual identifier string.
A simple pair of identifier info and location.
SourceLocation getLoc() const
IdentifierInfo * getIdentifierInfo() const
bool isCompatibleWithMSVC() const
ParsedAttr - Represents a syntactic attribute.
unsigned getSemanticSpelling() const
If the parsed attribute has a semantic equivalent, and it would have a semantic Spelling enumeration ...
bool existsInTarget(const TargetInfo &Target) const
IdentifierLoc * getArgAsIdent(unsigned Arg) const
const ParsedAttrInfo & getInfo() const
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this attribute.
bool isArgIdent(unsigned Arg) const
Expr * getArgAsExpr(unsigned Arg) const
bool checkAtLeastNumArgs(class Sema &S, unsigned Num) const
Check if the attribute has at least as many args as Num.
AttributeCommonInfo::Kind getKind() const
bool checkAtMostNumArgs(class Sema &S, unsigned Num) const
Check if the attribute has at most as many args as Num.
ParsedAttributes - A collection of parsed attributes.
Scope - A scope is a transient data structure that is used while parsing the program.
bool isFunctionScope() const
isFunctionScope() - Return true if this scope is a function scope.
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID)
Emit a diagnostic.
Sema - This implements semantic analysis and AST building for C.
Scope * getCurScope() const
Retrieve the parser's current scope.
void ProcessStmtAttributes(Stmt *Stmt, const ParsedAttributes &InAttrs, SmallVectorImpl< const Attr * > &OutAttrs)
Process the attributes before creating an attributed statement.
bool checkCommonAttributeFeatures(const Decl *D, const ParsedAttr &A, bool SkipArgCountCheck=false)
Handles semantic checking for features that are common to all attributes, such as checking whether a ...
ExprResult BuildCXXAssumeExpr(Expr *Assumption, const IdentifierInfo *AttrName, SourceRange Range)
ASTContext & getASTContext() const
SourceLocation getLocForEndOfToken(SourceLocation Loc, unsigned Offset=0)
Calls Lexer::getLocForEndOfToken()
const LangOptions & getLangOpts() const
bool DiagnoseUnexpandedParameterPack(SourceLocation Loc, TypeSourceInfo *T, UnexpandedParameterPackContext UPPC)
If the given type contains an unexpanded parameter pack, diagnose the error.
sema::FunctionScopeInfo * getCurFunction() const
bool CheckLoopHintExpr(Expr *E, SourceLocation Loc, bool AllowZero)
ExprResult PerformContextuallyConvertToBool(Expr *From)
PerformContextuallyConvertToBool - Perform a contextual conversion of the expression From to bool (C+...
ExprResult CheckPlaceholderExpr(Expr *E)
Check for operands with placeholder types and complain if found.
bool CheckRebuiltStmtAttributes(ArrayRef< const Attr * > Attrs)
bool CheckNoInlineAttr(const Stmt *OrigSt, const Stmt *CurSt, const AttributeCommonInfo &A)
bool CheckAlwaysInlineAttr(const Stmt *OrigSt, const Stmt *CurSt, const AttributeCommonInfo &A)
void DiagnoseUnknownAttribute(const ParsedAttr &AL)
ExprResult ActOnCXXAssumeAttr(Stmt *St, const ParsedAttr &A, SourceRange Range)
ExprResult VerifyIntegerConstantExpression(Expr *E, llvm::APSInt *Result, VerifyICEDiagnoser &Diagnoser, AllowFoldKind CanFold=AllowFoldKind::No)
VerifyIntegerConstantExpression - Verifies that an expression is an ICE, and reports the appropriate ...
Attr * CreateAnnotationAttr(const AttributeCommonInfo &CI, StringRef Annot, MutableArrayRef< Expr * > Args)
CreateAnnotationAttr - Creates an annotation Annot with Args arguments.
CodeAlignAttr * BuildCodeAlignAttr(const AttributeCommonInfo &CI, Expr *E)
bool checkStringLiteralArgumentAttr(const AttributeCommonInfo &CI, const Expr *E, StringRef &Str, SourceLocation *ArgLocation=nullptr)
Check if the argument E is a ASCII string literal.
ExprResult ActOnFinishFullExpr(Expr *Expr, bool DiscardedValue)
Encodes a location in the source.
A trivial tuple used to represent a source range.
SourceLocation getBegin() const
Stmt - This represents one statement.
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
SourceLocation getBeginLoc() const LLVM_READONLY
Exposes information about the current target.
bool isAtomicType() const
Defines the clang::TargetInfo interface.
Top level wrappers for InstallAPI frontend operations.
bool isa(CodeGen::Address addr)
@ AANT_ArgumentIntegerConstant
@ AANT_ArgumentIdentifier
U cast(CodeGen::Address addr)
ActionResult< Expr * > ExprResult
Describes how types, statements, expressions, and declarations should be printed.