diff options
Diffstat (limited to 'contrib/llvm/tools/clang/lib/Basic/Attributes.cpp')
| -rw-r--r-- | contrib/llvm/tools/clang/lib/Basic/Attributes.cpp | 28 | 
1 files changed, 28 insertions, 0 deletions
diff --git a/contrib/llvm/tools/clang/lib/Basic/Attributes.cpp b/contrib/llvm/tools/clang/lib/Basic/Attributes.cpp new file mode 100644 index 000000000000..b7570d03c85a --- /dev/null +++ b/contrib/llvm/tools/clang/lib/Basic/Attributes.cpp @@ -0,0 +1,28 @@ +#include "clang/Basic/Attributes.h" +#include "clang/Basic/AttrSubjectMatchRules.h" +#include "clang/Basic/IdentifierTable.h" +#include "llvm/ADT/StringSwitch.h" +using namespace clang; + +int clang::hasAttribute(AttrSyntax Syntax, const IdentifierInfo *Scope, +                        const IdentifierInfo *Attr, const TargetInfo &Target, +                        const LangOptions &LangOpts) { +  StringRef Name = Attr->getName(); +  // Normalize the attribute name, __foo__ becomes foo. +  if (Name.size() >= 4 && Name.startswith("__") && Name.endswith("__")) +    Name = Name.substr(2, Name.size() - 4); + +#include "clang/Basic/AttrHasAttributeImpl.inc" + +  return 0; +} + +const char *attr::getSubjectMatchRuleSpelling(attr::SubjectMatchRule Rule) { +  switch (Rule) { +#define ATTR_MATCH_RULE(NAME, SPELLING, IsAbstract)                            \ +  case attr::NAME:                                                             \ +    return SPELLING; +#include "clang/Basic/AttrSubMatchRulesList.inc" +  } +  llvm_unreachable("Invalid subject match rule"); +}  | 
