summaryrefslogtreecommitdiffstats
path: root/lib/Sema/AttributeList.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2014-01-20 17:18:35 +0000
committerAaron Ballman <aaron@aaronballman.com>2014-01-20 17:18:35 +0000
commit1e6097c61dd8b3fb2b6b9cd34e88bfa29500f814 (patch)
tree0a5f1f98a78b554bf66fa781ada8e25438048f44 /lib/Sema/AttributeList.cpp
parentd1ee17a6945e4a58161fb9b16510ee1399247c2c (diff)
Remove some hard-coded specialness for thread-safety attributes from the parser, and made it more declarative. If an attribute is allowed to appear on a function definition when late parsed, it can now use the FunctionDefinition attribute subject. It's treated as a FunctionDecl for most purposes, except it also gets exposed on the AttributeList so that it can be used while parsing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199676 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/AttributeList.cpp')
-rw-r--r--lib/Sema/AttributeList.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Sema/AttributeList.cpp b/lib/Sema/AttributeList.cpp
index 834001c666..6ffc02776e 100644
--- a/lib/Sema/AttributeList.cpp
+++ b/lib/Sema/AttributeList.cpp
@@ -150,6 +150,7 @@ struct ParsedAttrInfo {
unsigned HasCustomParsing : 1;
unsigned IsTargetSpecific : 1;
unsigned IsType : 1;
+ unsigned CanAppearOnFuncDef : 1;
bool (*DiagAppertainsToDecl)(Sema &S, const AttributeList &Attr,
const Decl *);
@@ -196,3 +197,7 @@ bool AttributeList::isTypeAttr() const {
bool AttributeList::existsInTarget(llvm::Triple T) const {
return getInfo(*this).ExistsInTarget(T);
}
+
+bool AttributeList::canAppearOnFunctionDefinition() const {
+ return getInfo(*this).CanAppearOnFuncDef;
+}