2014-03-31 21:14:44 +08:00
|
|
|
#include "clang/Basic/Attributes.h"
|
|
|
|
#include "clang/Basic/IdentifierTable.h"
|
|
|
|
#include "llvm/ADT/StringSwitch.h"
|
|
|
|
using namespace clang;
|
|
|
|
|
2014-11-14 21:44:02 +08:00
|
|
|
int clang::hasAttribute(AttrSyntax Syntax, const IdentifierInfo *Scope,
|
2015-07-21 06:57:31 +08:00
|
|
|
const IdentifierInfo *Attr, const TargetInfo &Target,
|
|
|
|
const LangOptions &LangOpts) {
|
2014-03-31 21:14:44 +08:00
|
|
|
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"
|
|
|
|
|
2014-11-14 21:44:02 +08:00
|
|
|
return 0;
|
2014-03-31 21:14:44 +08:00
|
|
|
}
|