summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/AttributeList.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2014-01-24 21:32:49 +0000
committerAaron Ballman <aaron@aaronballman.com>2014-01-24 21:32:49 +0000
commit81cb8cbfa6a6ad7bb86e231f2a63b73a0b007ebd (patch)
tree039f051c7f89d427b32029bf879b4772d6ab91bf /clang/lib/Sema/AttributeList.cpp
parentafcc3df7f4db85832b13a6f4d58e24ac9e7ccc43 (diff)
downloadbcm5719-llvm-81cb8cbfa6a6ad7bb86e231f2a63b73a0b007ebd.tar.gz
bcm5719-llvm-81cb8cbfa6a6ad7bb86e231f2a63b73a0b007ebd.zip
Adds a getSemanticSpelling function to semantic attribute subclasses which have a meaningful semantic spelling. Adds a sibling function to parsed attribtues (via AttributeList) for getting the semantic spelling, if one were to exist. This can be used for cleaner code that deals directly with the semantic spellings (such as the MSInheritance attribute).
llvm-svn: 200041
Diffstat (limited to 'clang/lib/Sema/AttributeList.cpp')
-rw-r--r--clang/lib/Sema/AttributeList.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Sema/AttributeList.cpp b/clang/lib/Sema/AttributeList.cpp
index 6ffc02776ef..aa6f72b2371 100644
--- a/clang/lib/Sema/AttributeList.cpp
+++ b/clang/lib/Sema/AttributeList.cpp
@@ -156,6 +156,7 @@ struct ParsedAttrInfo {
const Decl *);
bool (*DiagLangOpts)(Sema &S, const AttributeList &Attr);
bool (*ExistsInTarget)(llvm::Triple T);
+ unsigned (*SpellingIndexToSemanticSpelling)(const AttributeList &Attr);
};
namespace {
@@ -201,3 +202,7 @@ bool AttributeList::existsInTarget(llvm::Triple T) const {
bool AttributeList::canAppearOnFunctionDefinition() const {
return getInfo(*this).CanAppearOnFuncDef;
}
+
+unsigned AttributeList::getSemanticSpelling() const {
+ return getInfo(*this).SpellingIndexToSemanticSpelling(*this);
+}
OpenPOWER on IntegriCloud