[clang] Extract function for generated part of clang::hasAttribute (NFC)
This makes it easier to add additional handling when the tablegen-generated code does not find a match. No functional change intended. Differential Revision: https://reviews.llvm.org/D144404
This commit is contained in:
parent
446f78092f
commit
8629343a8b
|
@ -4,6 +4,15 @@
|
|||
#include "clang/Basic/IdentifierTable.h"
|
||||
using namespace clang;
|
||||
|
||||
static int hasAttributeImpl(AttributeCommonInfo::Syntax Syntax, StringRef Name,
|
||||
StringRef ScopeName, const TargetInfo &Target,
|
||||
const LangOptions &LangOpts) {
|
||||
|
||||
#include "clang/Basic/AttrHasAttributeImpl.inc"
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int clang::hasAttribute(AttributeCommonInfo::Syntax Syntax,
|
||||
const IdentifierInfo *Scope, const IdentifierInfo *Attr,
|
||||
const TargetInfo &Target, const LangOptions &LangOpts) {
|
||||
|
@ -27,7 +36,9 @@ int clang::hasAttribute(AttributeCommonInfo::Syntax Syntax,
|
|||
ScopeName == "omp")
|
||||
return (Name == "directive" || Name == "sequence") ? 1 : 0;
|
||||
|
||||
#include "clang/Basic/AttrHasAttributeImpl.inc"
|
||||
int res = hasAttributeImpl(Syntax, Name, ScopeName, Target, LangOpts);
|
||||
if (res)
|
||||
return res;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user