File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -193,11 +193,20 @@ bool ParsedAttr::isTypeAttr() const { return getInfo().IsType; }
193
193
bool ParsedAttr::isStmtAttr () const { return getInfo ().IsStmt ; }
194
194
195
195
bool ParsedAttr::existsInTarget (const TargetInfo &Target) const {
196
- return getInfo ().existsInTarget (Target) &&
197
- getInfo ().spellingExistsInTarget (Target,
198
- getAttributeSpellingListIndex ());
196
+ Kind K = getParsedKind ();
197
+
198
+ // If the attribute has a target-specific spelling, check that it exists.
199
+ // Only call this if the attr is not ignored/unknown. For most targets, this
200
+ // function just returns true.
201
+ bool HasSpelling = K != IgnoredAttribute && K != UnknownAttribute &&
202
+ K != NoSemaHandlerAttribute;
203
+ bool TargetSpecificSpellingExists = !HasSpelling ||
204
+ getInfo ().spellingExistsInTarget (Target, getAttributeSpellingListIndex ());
205
+
206
+ return getInfo ().existsInTarget (Target) && TargetSpecificSpellingExists;
199
207
}
200
208
209
+
201
210
bool ParsedAttr::isKnownToGCC () const { return getInfo ().IsKnownToGCC ; }
202
211
203
212
bool ParsedAttr::isSupportedByPragmaAttribute () const {
You can’t perform that action at this time.
0 commit comments