blob: da9ac793f163b6b26cf459bc5cb5e83c5fa82f4b [file] [log] [blame]
Stephen Hines651f13c2014-04-23 16:59:28 -07001#include "clang/Basic/Attributes.h"
2#include "clang/Basic/IdentifierTable.h"
3#include "llvm/ADT/StringSwitch.h"
4using namespace clang;
5
Stephen Hines176edba2014-12-01 14:53:08 -08006int clang::hasAttribute(AttrSyntax Syntax, const IdentifierInfo *Scope,
Stephen Hines651f13c2014-04-23 16:59:28 -07007 const IdentifierInfo *Attr, const llvm::Triple &T,
8 const LangOptions &LangOpts) {
9 StringRef Name = Attr->getName();
10 // Normalize the attribute name, __foo__ becomes foo.
11 if (Name.size() >= 4 && Name.startswith("__") && Name.endswith("__"))
12 Name = Name.substr(2, Name.size() - 4);
13
14#include "clang/Basic/AttrHasAttributeImpl.inc"
15
Stephen Hines176edba2014-12-01 14:53:08 -080016 return 0;
Stephen Hines651f13c2014-04-23 16:59:28 -070017}