summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/AttributeList.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/AttributeList.cpp')
-rw-r--r--clang/lib/Sema/AttributeList.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/lib/Sema/AttributeList.cpp b/clang/lib/Sema/AttributeList.cpp
index 101e0384fa7..8e7029350ab 100644
--- a/clang/lib/Sema/AttributeList.cpp
+++ b/clang/lib/Sema/AttributeList.cpp
@@ -15,6 +15,7 @@
#include "clang/AST/Expr.h"
#include "clang/Basic/IdentifierTable.h"
#include "llvm/ADT/StringSwitch.h"
+#include "llvm/ADT/SmallString.h"
using namespace clang;
size_t AttributeList::allocated_size() const {
@@ -99,7 +100,8 @@ AttributePool::createIntegerAttribute(ASTContext &C, IdentifierInfo *Name,
#include "clang/Sema/AttrParsedAttrKinds.inc"
-AttributeList::Kind AttributeList::getKind(const IdentifierInfo *Name) {
+AttributeList::Kind AttributeList::getKind(const IdentifierInfo *Name,
+ const IdentifierInfo *ScopeName) {
StringRef AttrName = Name->getName();
// Normalize the attribute name, __foo__ becomes foo.
@@ -107,5 +109,10 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo *Name) {
AttrName.size() >= 4)
AttrName = AttrName.substr(2, AttrName.size() - 4);
+ // FIXME: implement attribute namespacing correctly.
+ SmallString<64> Buf;
+ if (ScopeName)
+ AttrName = ((Buf += ScopeName->getName()) += "___") += AttrName;
+
return ::getAttrKind(AttrName);
}
OpenPOWER on IntegriCloud