Attributes.cpp 612 B

1234567891011121314151617
  1. #include "clang/Basic/Attributes.h"
  2. #include "clang/Basic/IdentifierTable.h"
  3. #include "llvm/ADT/StringSwitch.h"
  4. using namespace clang;
  5. int clang::hasAttribute(AttrSyntax Syntax, const IdentifierInfo *Scope,
  6. const IdentifierInfo *Attr, const llvm::Triple &T,
  7. const LangOptions &LangOpts) {
  8. StringRef Name = Attr->getName();
  9. // Normalize the attribute name, __foo__ becomes foo.
  10. if (Name.size() >= 4 && Name.startswith("__") && Name.endswith("__"))
  11. Name = Name.substr(2, Name.size() - 4);
  12. #include "clang/Basic/AttrHasAttributeImpl.inc"
  13. return 0;
  14. }