21 using namespace clang;
30 : S(S), SlotLabel(SlotLabel), ShouldAct(ShouldAct) {
71 if (PackedInclude.HasNonDefaultValue)
72 PackedInclude.ShouldWarnOnInclude =
true;
84 RD->
addAttr(MSVtorDispAttr::CreateImplicit(
88 template <
typename Attribute>
91 if (Record->
hasAttr<OwnerAttr>() || Record->
hasAttr<PointerAttr>())
95 Redecl->addAttr(Attribute::CreateImplicit(Context,
nullptr));
100 if (!UnderlyingRecord)
107 static llvm::StringSet<> Containers{
123 "unordered_multiset",
124 "unordered_multimap",
127 static llvm::StringSet<> Iterators{
"iterator",
"const_iterator",
129 "const_reverse_iterator"};
131 if (
Parent->isInStdNamespace() && Iterators.count(ND->
getName()) &&
132 Containers.count(
Parent->getName()))
133 addGslOwnerPointerAttributeIfNotExisting<PointerAttr>(
Context,
144 dyn_cast<TemplateSpecializationType>(Canonical.
getTypePtr())) {
146 RD = dyn_cast_or_null<CXXRecordDecl>(
147 TST->getTemplateName().getAsTemplateDecl()->getTemplatedDecl());
155 static llvm::StringSet<> StdOwners{
175 "unordered_multiset",
176 "unordered_multimap",
179 static llvm::StringSet<> StdPointers{
190 if (Record->
hasAttr<OwnerAttr>() || Record->
hasAttr<PointerAttr>())
193 if (StdOwners.count(Record->
getName()))
194 addGslOwnerPointerAttributeIfNotExisting<OwnerAttr>(
Context, Record);
195 else if (StdPointers.count(Record->
getName()))
196 addGslOwnerPointerAttributeIfNotExisting<PointerAttr>(
Context, Record);
208 unsigned Alignment = 0;
230 Diag(PragmaLoc, diag::err_pragma_options_align_mac68k_target_unsupported);
245 Diag(PragmaLoc, diag::warn_pragma_options_align_reset_failed)
253 PackStack.
Act(PragmaLoc, Action, StringRef(), Alignment);
260 case PragmaClangSectionKind::PCSK_BSS:
263 case PragmaClangSectionKind::PCSK_Data:
266 case PragmaClangSectionKind::PCSK_Rodata:
269 case PragmaClangSectionKind::PCSK_Relro:
272 case PragmaClangSectionKind::PCSK_Text:
276 llvm_unreachable(
"invalid clang section kind");
279 if (Action == PragmaClangSectionAction::PCSA_Clear) {
290 StringRef SlotLabel,
Expr *alignment) {
291 Expr *Alignment =
static_cast<Expr *
>(alignment);
294 unsigned AlignmentVal = 0;
303 !(Val == 0 || Val.isPowerOf2()) ||
304 Val.getZExtValue() > 16) {
305 Diag(PragmaLoc, diag::warn_pragma_pack_invalid_alignment);
309 AlignmentVal = (unsigned) Val.getZExtValue();
316 if (AlignmentVal == 0)
319 Diag(PragmaLoc, diag::warn_pragma_pack_show) <<
"mac68k";
321 Diag(PragmaLoc, diag::warn_pragma_pack_show) << AlignmentVal;
326 if (Alignment && !SlotLabel.empty())
327 Diag(PragmaLoc, diag::warn_pragma_pack_pop_identifier_and_alignment);
329 Diag(PragmaLoc, diag::warn_pragma_pop_failed) <<
"pack" <<
"stack empty";
332 PackStack.
Act(PragmaLoc, Action, SlotLabel, AlignmentVal);
344 bool HasNonDefaultValue =
351 HasNonDefaultValue,
false});
359 Diag(IncludeLoc, diag::warn_pragma_pack_non_default_at_include);
364 Diag(IncludeLoc, diag::warn_pragma_pack_modified_after_include);
372 bool IsInnermost =
true;
374 Diag(StackSlot.PragmaPushLocation, diag::warn_pragma_pack_no_pop_eof);
379 diag::note_pragma_pack_pop_instead_reset);
421 Diag(PragmaLoc, diag::warn_pragma_pop_failed) <<
"vtordisp" 426 template<
typename ValueType>
429 llvm::StringRef StackSlotLabel,
432 CurrentValue = DefaultValue;
433 CurrentPragmaLocation = PragmaLocation;
437 Stack.emplace_back(StackSlotLabel, CurrentValue, CurrentPragmaLocation,
440 if (!StackSlotLabel.empty()) {
442 auto I = llvm::find_if(llvm::reverse(Stack), [&](
const Slot &x) {
443 return x.StackSlotLabel == StackSlotLabel;
446 if (I != Stack.rend()) {
447 CurrentValue = I->Value;
448 CurrentPragmaLocation = I->PragmaLocation;
449 Stack.erase(std::prev(I.base()), Stack.end());
451 }
else if (!Stack.empty()) {
453 CurrentValue = Stack.back().Value;
454 CurrentPragmaLocation = Stack.back().PragmaLocation;
459 CurrentValue =
Value;
460 CurrentPragmaLocation = PragmaLocation;
474 if (Section->second.SectionFlags == SectionFlags ||
477 auto OtherDecl = Section->second.Decl;
479 << Decl << OtherDecl;
480 Diag(OtherDecl->getLocation(), diag::note_declared_at)
481 << OtherDecl->getName();
482 if (
auto A = Decl->
getAttr<SectionAttr>())
484 Diag(A->getLocation(), diag::note_pragma_entered_here);
485 if (
auto A = OtherDecl->getAttr<SectionAttr>())
487 Diag(A->getLocation(), diag::note_pragma_entered_here);
496 if (Section->second.SectionFlags == SectionFlags)
499 Diag(PragmaSectionLocation, diag::err_section_conflict)
500 <<
"this" <<
"a prior #pragma section";
501 Diag(Section->second.PragmaSectionLocation,
502 diag::note_pragma_entered_here);
514 llvm::StringRef StackSlotLabel,
516 llvm::StringRef PragmaName) {
518 llvm::StringSwitch<PragmaStack<StringLiteral *> *>(PragmaName)
524 Diag(PragmaLocation, diag::warn_pragma_pop_failed) << PragmaName
530 if (SegmentName->
getString() ==
".drectve" &&
532 Diag(PragmaLocation, diag::warn_attribute_section_drectve) << PragmaName;
535 Stack->
Act(PragmaLocation, Action, StackSlotLabel, SegmentName);
560 if (Lookup.empty()) {
561 Diag(PragmaLoc, diag::warn_pragma_unused_undeclared_var)
568 Diag(PragmaLoc, diag::warn_pragma_unused_expected_var_arg)
575 Diag(PragmaLoc, diag::warn_used_but_marked_unused) << Name;
579 UnusedAttr::GNU_unused));
589 if (D->
hasAttr<CFAuditedTransferAttr>() ||
590 D->
hasAttr<CFUnknownTransferAttr>())
602 using namespace attr;
606 #define ATTR_MATCH_RULE(Value, Spelling, IsAbstract) 607 #define ATTR_MATCH_SUB_RULE(Value, Spelling, IsAbstract, Parent, IsNegated) \ 610 #include "clang/Basic/AttrSubMatchRulesList.inc" 615 using namespace attr;
619 #define ATTR_MATCH_RULE(Value, Spelling, IsAbstract) 620 #define ATTR_MATCH_SUB_RULE(Value, Spelling, IsAbstract, Parent, IsNegated) \ 623 #include "clang/Basic/AttrSubMatchRulesList.inc" 642 llvm::raw_string_ostream OS(Result);
643 for (
const auto &I : llvm::enumerate(Rules)) {
645 OS << (I.index() == Rules.size() - 1 ?
", and " :
", ");
660 StrictSubjectMatchRuleSet;
664 if (StrictSubjectMatchRuleSet.empty()) {
671 llvm::SmallDenseMap<int, std::pair<int, SourceRange>, 2>
672 RulesToFirstSpecifiedNegatedSubRule;
673 for (
const auto &Rule : Rules) {
676 getParentAttrMatcherRule(MatchRule);
679 auto It = Rules.find(*ParentRule);
680 if (It != Rules.end()) {
682 Diag(Rule.second.getBegin(),
683 diag::err_pragma_attribute_matcher_subrule_contradicts_rule)
687 replacementRangeForListElement(*
this, Rule.second));
692 if (isNegatedAttrMatcherSubRule(MatchRule))
693 RulesToFirstSpecifiedNegatedSubRule.insert(
694 std::make_pair(*ParentRule, Rule));
696 bool IgnoreNegatedSubRules =
false;
697 for (
const auto &Rule : Rules) {
700 getParentAttrMatcherRule(MatchRule);
703 auto It = RulesToFirstSpecifiedNegatedSubRule.find(*ParentRule);
704 if (It != RulesToFirstSpecifiedNegatedSubRule.end() &&
705 It->second != Rule) {
708 It->second.second.getBegin(),
710 err_pragma_attribute_matcher_negated_subrule_contradicts_subrule)
715 replacementRangeForListElement(*
this, It->second.second));
717 IgnoreNegatedSubRules =
true;
718 RulesToFirstSpecifiedNegatedSubRule.erase(It);
722 if (!IgnoreNegatedSubRules) {
723 for (
const auto &Rule : Rules)
726 for (
const auto &Rule : Rules) {
733 for (
const auto &Rule : StrictSubjectMatchRuleSet) {
734 if (Rules.erase(Rule.first)) {
738 SubjectMatchRules.push_back(Rule.first);
743 if (!Rules.empty()) {
745 Diag(PragmaLoc, diag::err_pragma_attribute_invalid_matchers)
748 for (
const auto &Rule : Rules) {
751 replacementRangeForListElement(*
this, Rule.second));
753 Diagnostic << attrMatcherRuleListToString(ExtraRules);
757 Diag(PragmaLoc, diag::err_pragma_attr_attr_no_push);
762 {PragmaLoc, &Attribute, std::move(SubjectMatchRules),
false});
775 Diag(PragmaLoc, diag::err_pragma_attribute_stack_mismatch) << 1;
789 assert(Entry.Attribute &&
"Expected an attribute");
790 Diag(Entry.Attribute->getLoc(), diag::warn_pragma_attribute_unused)
792 Diag(PragmaLoc, diag::note_pragma_attribute_region_ends_here);
801 Diag(PragmaLoc, diag::err_pragma_attribute_stack_mismatch)
804 Diag(PragmaLoc, diag::err_pragma_attribute_stack_mismatch) << 1;
811 for (
auto &Entry : Group.Entries) {
813 assert(Attribute &&
"Expected an attribute");
815 "expected #pragma clang attribute");
818 bool Applies =
false;
819 for (
const auto &Rule : Entry.MatchRules) {
840 diag::note_pragma_attribute_applied_decl_here);
866 if (FD->
hasAttr<MinSizeAttr>() || FD->
hasAttr<AlwaysInlineAttr>())
871 if (!FD->
hasAttr<OptimizeNoneAttr>())
873 if (!FD->
hasAttr<NoInlineAttr>())
877 typedef std::vector<std::pair<unsigned, SourceLocation> >
VisStack;
889 unsigned rawType = Stack->back().first;
892 VisibilityAttr::VisibilityType
type 893 = (VisibilityAttr::VisibilityType) rawType;
911 Stack->push_back(std::make_pair(type, loc));
918 VisibilityAttr::VisibilityType T;
919 if (!VisibilityAttr::ConvertStrToVisibilityType(VisType->
getName(), T)) {
920 Diag(PragmaLoc, diag::warn_attribute_unknown_visibility) << VisType;
966 Diag(EndLoc, diag::err_pragma_pop_visibility_mismatch);
973 const std::pair<unsigned, SourceLocation> *Back = &Stack->back();
975 if (StartsWithPragma && IsNamespaceEnd) {
976 Diag(Back->second, diag::err_pragma_push_visibility_mismatch);
977 Diag(EndLoc, diag::note_surrounding_namespace_ends_here);
982 Back = &Stack->back();
984 }
while (StartsWithPragma);
985 }
else if (!StartsWithPragma && !IsNamespaceEnd) {
986 Diag(EndLoc, diag::err_pragma_pop_visibility_mismatch);
987 Diag(Back->second, diag::note_surrounding_namespace_starts_here);
void ActOnPragmaAttributeEmptyPush(SourceLocation PragmaLoc, const IdentifierInfo *Namespace)
PragmaStack< StringLiteral * > CodeSegStack
MSVtorDispMode
In the Microsoft ABI, this controls the placement of virtual displacement members used to implement v...
Represents a function declaration or definition.
void ActOnPragmaAttributeAttribute(ParsedAttr &Attribute, SourceLocation PragmaLoc, attr::ParsedSubjectMatchRuleSet Rules)
PragmaStackSentinelRAII(Sema &S, StringRef SlotLabel, bool ShouldAct)
A (possibly-)qualified type.
void ActOnPragmaMSStruct(PragmaMSStructKind Kind)
ActOnPragmaMSStruct - Called on well formed #pragma ms_struct [on|off].
void SentinelAction(PragmaMsStackAction Action, StringRef Label)
SmallVector< PackIncludeState, 8 > PackIncludeStack
PragmaStack< StringLiteral * > DataSegStack
Ordinary name lookup, which finds ordinary names (functions, variables, typedefs, etc...
void ActOnPragmaMSSeg(SourceLocation PragmaLocation, PragmaMsStackAction Action, llvm::StringRef StackSlotLabel, StringLiteral *SegmentName, llvm::StringRef PragmaName)
Called on well formed #pragma bss_seg/data_seg/const_seg/code_seg.
static CharSourceRange getTokenRange(SourceRange R)
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID)
Emit a diagnostic.
Decl - This represents one declaration (or definition), e.g.
void ProcessDeclAttributeList(Scope *S, Decl *D, const ParsedAttributesView &AL, bool IncludeCXX11Attributes=true)
SourceLocation getBeginLoc() const LLVM_READONLY
bool LookupParsedName(LookupResult &R, Scope *S, CXXScopeSpec *SS, bool AllowBuiltinCreation=false, bool EnteringContext=false)
Performs name lookup for a name that was parsed in the source code, and may contain a C++ scope speci...
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
const TargetInfo & getTargetInfo() const
Represents a variable declaration or definition.
DiagnosticsEngine & Diags
PragmaClangSection PragmaClangBSSSection
void ActOnPragmaMSVtorDisp(PragmaMsStackAction Action, SourceLocation PragmaLoc, MSVtorDispMode Value)
Called on well formed #pragma vtordisp().
IdentifierInfo * getIdentifier() const
Get the identifier that names this declaration, if there is one.
Represents a struct/union/class.
void FreeVisContext()
FreeVisContext - Deallocate and null out VisContext.
One of these records is kept for each identifier that is lexed.
TargetCXXABI getCXXABI() const
Get the C++ ABI currently in use.
SubjectMatchRule
A list of all the recognized kinds of attributes.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
void getMatchRules(const LangOptions &LangOpts, SmallVectorImpl< std::pair< attr::SubjectMatchRule, bool >> &MatchRules) const
bool checkSectionName(SourceLocation LiteralLoc, StringRef Str)
void ActOnPragmaAttributePop(SourceLocation PragmaLoc, const IdentifierInfo *Namespace)
Called on well-formed '#pragma clang attribute pop'.
Token - This structure provides full information about a lexed token.
static void addGslOwnerPointerAttributeIfNotExisting(ASTContext &Context, CXXRecordDecl *Record)
static void PushPragmaVisibility(Sema &S, unsigned type, SourceLocation loc)
void setIsPragmaClangAttribute()
void ActOnPragmaMSSection(SourceLocation PragmaLocation, int SectionFlags, StringLiteral *SegmentName)
Called on well formed #pragma section().
Represents the results of name lookup.
void ActOnPragmaOptionsAlign(PragmaOptionsAlignKind Kind, SourceLocation PragmaLoc)
ActOnPragmaOptionsAlign - Called on well formed #pragma options align.
bool UnifySection(StringRef SectionName, int SectionFlags, DeclaratorDecl *TheDecl)
void AddPushedVisibilityAttribute(Decl *RD)
AddPushedVisibilityAttribute - If '#pragma GCC visibility' was used, add an appropriate visibility at...
Scope - A scope is a transient data structure that is used while parsing the program.
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
void ActOnPragmaFPContract(LangOptions::FPContractModeKind FPC)
ActOnPragmaFPContract - Called on well formed #pragma {STDC,OPENCL} FP_CONTRACT and #pragma clang fp ...
void setAllowFPContractWithinStatement()
void ActOnPragmaDetectMismatch(SourceLocation Loc, StringRef Name, StringRef Value)
ActOnPragmaDetectMismatch - Call on well-formed #pragma detect_mismatch.
const LangOptions & getLangOpts() const
bool isTypeDependent() const
isTypeDependent - Determines whether this expression is type-dependent (C++ [temp.dep.expr]), which means that its type could change from one template instantiation to the next.
void addAtEnd(ParsedAttr *newAttr)
void DiagnoseNonDefaultPragmaPack(PragmaPackDiagnoseKind Kind, SourceLocation IncludeLoc)
const LangOptions & LangOpts
void PopPragmaVisibility(bool IsNamespaceEnd, SourceLocation EndLoc)
PopPragmaVisibility - Pop the top element of the visibility stack; used for '#pragma GCC visibility' ...
void PrintPragmaAttributeInstantiationPoint()
llvm::StringMap< SectionInfo > SectionInfos
Sema - This implements semantic analysis and AST building for C.
StringRef getString() const
A little helper class used to produce diagnostics.
CXXRecordDecl * getAsCXXRecordDecl() const
Retrieves the CXXRecordDecl that this type refers to, either because the type is a RecordType or beca...
Represents a ValueDecl that came out of a declarator.
std::vector< std::pair< unsigned, SourceLocation > > VisStack
const Decl * PragmaAttributeCurrentTargetDecl
The declaration that is currently receiving an attribute from the #pragma attribute stack...
void setDisallowFPContract()
This represents one expression.
Represents a character-granular source range.
static SourceLocation findLocationAfterToken(SourceLocation loc, tok::TokenKind TKind, const SourceManager &SM, const LangOptions &LangOpts, bool SkipTrailingWhitespaceAndNewLine)
Checks that the given token is the first token that occurs after the given location (this excludes co...
void ActOnPragmaMSInitSeg(SourceLocation PragmaLocation, StringLiteral *SegmentName)
Called on well-formed #pragma init_seg().
SourceLocation getLocation() const
Return a source location identifier for the specified offset in the current file. ...
Defines the clang::Preprocessor interface.
DeclContext * getDeclContext()
PragmaStack< StringLiteral * > BSSSegStack
void ActOnPragmaUnused(const Token &Identifier, Scope *curScope, SourceLocation PragmaLoc)
ActOnPragmaUnused - Called on well-formed '#pragma unused'.
void ActOnPragmaMSComment(SourceLocation CommentLoc, PragmaMSCommentKind Kind, StringRef Arg)
ActOnPragmaMSComment - Called on well formed #pragma comment(kind, "arg").
SourceLocation getEnd() const
~PragmaStackSentinelRAII()
bool hasAlignMac68kSupport() const
Check whether this target support '#pragma options align=mac68k'.
void AddOptnoneAttributeIfNoConflicts(FunctionDecl *FD, SourceLocation Loc)
Adds the 'optnone' attribute to the function declaration if there are no conflicts; Loc represents th...
The result type of a method or function.
void DiagnoseUnterminatedPragmaPack()
PragmaClangSectionKind
pragma clang section kind
static CharSourceRange getCharRange(SourceRange R)
void AddRangeBasedOptnone(FunctionDecl *FD)
Only called on function definitions; if there is a pragma in scope with the effect of a range-based o...
StringLiteral * CurInitSeg
Last section used with #pragma init_seg.
QualType getCanonicalType() const
redecl_range redecls() const
Returns an iterator range for all the redeclarations of the same decl.
Encodes a location in the source.
void Act(SourceLocation PragmaLocation, PragmaMsStackAction Action, llvm::StringRef StackSlotLabel, ValueType Value)
SourceLocation CurrentPragmaLocation
const char * getSubjectMatchRuleSpelling(SubjectMatchRule Rule)
void ActOnPragmaPack(SourceLocation PragmaLoc, PragmaMsStackAction Action, StringRef SlotLabel, Expr *Alignment)
ActOnPragmaPack - Called on well formed #pragma pack(...).
PragmaStack< MSVtorDispMode > VtorDispStack
Whether to insert vtordisps prior to virtual bases in the Microsoft C++ ABI.
IdentifierInfo * getIdentifierInfo() const
ParsedAttr - Represents a syntactic attribute.
SourceLocation PragmaLocation
bool isValueDependent() const
isValueDependent - Determines whether this expression is value-dependent (C++ [temp.dep.constexpr]).
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation OptimizeOffPragmaLocation
This represents the last location of a "#pragma clang optimize off" directive if such a directive has...
void ActOnPragmaClangSection(SourceLocation PragmaLoc, PragmaClangSectionAction Action, PragmaClangSectionKind SecKind, StringRef SecName)
ActOnPragmaClangSection - Called on well formed #pragma clang section.
bool isUsed(bool CheckUsedAttr=true) const
Whether any (re-)declaration of the entity was used, meaning that a definition is required...
PragmaMSPointersToMembersKind
StringRef getName() const
Return the actual identifier string.
Base class for declarations which introduce a typedef-name.
Dataflow Directional Tag Classes.
bool isValid() const
Return true if this is a valid SourceLocation object.
SourceLocation ImplicitMSInheritanceAttrLoc
Source location for newly created implicit MSInheritanceAttrs.
void AddAlignmentAttributesForRecord(RecordDecl *RD)
AddAlignmentAttributesForRecord - Adds any needed alignment attributes to a the record decl...
static PragmaDetectMismatchDecl * Create(const ASTContext &C, TranslationUnitDecl *DC, SourceLocation Loc, StringRef Name, StringRef Value)
std::pair< IdentifierInfo *, SourceLocation > getPragmaARCCFCodeAuditedInfo() const
The location of the currently-active #pragma clang arc_cf_code_audited begin.
QualType getUnderlyingType() const
static FixItHint CreateRemoval(CharSourceRange RemoveRange)
Create a code modification hint that removes the given source range.
void setDisallowFEnvAccess()
Do an LV computation for, ultimately, a non-type declaration.
PragmaClangSection PragmaClangRodataSection
bool isIntegerConstantExpr(llvm::APSInt &Result, const ASTContext &Ctx, SourceLocation *Loc=nullptr, bool isEvaluated=true) const
isIntegerConstantExpr - Return true if this expression is a valid integer constant expression...
void AddPragmaAttributes(Scope *S, Decl *D)
Adds the attributes that have been specified using the '#pragma clang attribute push' directives to t...
void DiagnoseUnterminatedPragmaAttribute()
PragmaClangSection PragmaClangDataSection
void ActOnPragmaMSPointersToMembers(LangOptions::PragmaMSPointersToMembersKind Kind, SourceLocation PragmaLoc)
ActOnPragmaMSPointersToMembers - called on well formed #pragma pointers_to_members(representation met...
SmallVector< PragmaAttributeGroup, 2 > PragmaAttributeStack
void setAllowFPContractAcrossStatement()
void inferGslOwnerPointerAttribute(CXXRecordDecl *Record)
Add [[gsl::Owner]] and [[gsl::Pointer]] attributes for std:: types.
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.
void addDecl(Decl *D)
Add the declaration D into this context.
PragmaStack< StringLiteral * > ConstSegStack
PragmaClangSection PragmaClangTextSection
Optional< Visibility > getExplicitVisibility(ExplicitVisibilityKind kind) const
If visibility was explicitly specified for this declaration, return that visibility.
void PushNamespaceVisibilityAttr(const VisibilityAttr *Attr, SourceLocation Loc)
PushNamespaceVisibilityAttr - Note that we've entered a namespace with a visibility attribute...
TranslationUnitDecl * getTranslationUnitDecl() const
void * VisContext
VisContext - Manages the stack for #pragma GCC visibility.
Represents a C++ struct/union/class.
LangOptions::PragmaMSPointersToMembersKind MSPointerToMemberRepresentationMethod
Controls member pointer representation format under the MS ABI.
PragmaClangSection PragmaClangRelroSection
llvm::DenseMap< int, SourceRange > ParsedSubjectMatchRuleSet
bool appliesToDecl(const Decl *D, attr::SubjectMatchRule MatchRule) const
SourceManager & getSourceManager() const
void setAllowFEnvAccess()
A little helper class (which is basically a smart pointer that forwards info from DiagnosticsEngine) ...
StringLiteral - This represents a string literal expression, e.g.
Defines the clang::TargetInfo interface.
bool isMicrosoft() const
Is this ABI an MSVC-compatible ABI?
StringRef getName() const
Get the name of identifier for this declaration as a StringRef.
void ActOnPragmaVisibility(const IdentifierInfo *VisType, SourceLocation PragmaLoc)
ActOnPragmaVisibility - Called on well formed #pragma GCC visibility... .
SourceManager & SourceMgr
void inferGslPointerAttribute(NamedDecl *ND, CXXRecordDecl *UnderlyingRecord)
Add gsl::Pointer attribute to std::container::iterator.
virtual bool HandleTopLevelDecl(DeclGroupRef D)
HandleTopLevelDecl - Handle the specified top-level declaration.
PragmaStack< unsigned > PackStack
A trivial tuple used to represent a source range.
This represents a decl that may have a name.
void ActOnPragmaFEnvAccess(LangOptions::FEnvAccessModeKind FPC)
ActOnPragmaFenvAccess - Called on well formed #pragma STDC FENV_ACCESS.
SourceLocation CurrentPragmaLocation
bool isInStdNamespace() const
void AddMsStructLayoutForRecord(RecordDecl *RD)
AddMsStructLayoutForRecord - Adds ms_struct layout attribute to record.
bool isPragmaClangAttribute() const
True if the attribute is specified using '#pragma clang attribute'.
SourceLocation getBegin() const
SmallVector< Slot, 2 > Stack
Attr - This represents one attribute.
SourceLocation getLocation() const
This an attribute introduced by #pragma clang attribute.
void ActOnPragmaOptimize(bool On, SourceLocation PragmaLoc)
Called on well formed #pragma clang optimize.
static const unsigned kMac68kAlignmentSentinel
void AddCFAuditedAttribute(Decl *D)
AddCFAuditedAttribute - Check whether we're currently within '#pragma clang arc_cf_code_audited' and...
SourceLocation CurInitSegLoc