diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:04:05 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:04:05 +0000 | 
| commit | 676fbe8105eeb6ff4bb2ed261cb212fcfdbe7b63 (patch) | |
| tree | 02a1ac369cb734d0abfa5000dd86e5b7797e6a74 /lib/Basic/Attributes.cpp | |
| parent | c7e70c433efc6953dc3888b9fbf9f3512d7da2b0 (diff) | |
Notes
Diffstat (limited to 'lib/Basic/Attributes.cpp')
| -rw-r--r-- | lib/Basic/Attributes.cpp | 9 | 
1 files changed, 8 insertions, 1 deletions
| diff --git a/lib/Basic/Attributes.cpp b/lib/Basic/Attributes.cpp index b7570d03c85a..9a8eb3d932cc 100644 --- a/lib/Basic/Attributes.cpp +++ b/lib/Basic/Attributes.cpp @@ -12,9 +12,16 @@ int clang::hasAttribute(AttrSyntax Syntax, const IdentifierInfo *Scope,    if (Name.size() >= 4 && Name.startswith("__") && Name.endswith("__"))      Name = Name.substr(2, Name.size() - 4); +  // Normalize the scope name, but only for gnu and clang attributes. +  StringRef ScopeName = Scope ? Scope->getName() : ""; +  if (ScopeName == "__gnu__") +    ScopeName = "gnu"; +  else if (ScopeName == "_Clang") +    ScopeName = "clang"; +  #include "clang/Basic/AttrHasAttributeImpl.inc" -  return 0; +  return 0;
  }  const char *attr::getSubjectMatchRuleSpelling(attr::SubjectMatchRule Rule) { | 
