summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclAttr.cpp
diff options
context:
space:
mode:
authorDeLesley Hutchins <delesley@google.com>2014-01-14 00:36:53 +0000
committerDeLesley Hutchins <delesley@google.com>2014-01-14 00:36:53 +0000
commitf28bbec90e447b0960aab0a00993ea93ebe294ab (patch)
tree8ab95cff57668ba9f404805dd2d3a380690d18f0 /clang/lib/Sema/SemaDeclAttr.cpp
parent6eba90710273be713b1f2736ce6d9c97bcf2f8be (diff)
downloadbcm5719-llvm-f28bbec90e447b0960aab0a00993ea93ebe294ab.tar.gz
bcm5719-llvm-f28bbec90e447b0960aab0a00993ea93ebe294ab.zip
Consumed analysis: add two new attributes which fine-tune the behavior of
consumable objects. These are useful for implementing error codes that must be checked. Patch also includes some significant refactoring, which was necesary to implement the new behavior. llvm-svn: 199169
Diffstat (limited to 'clang/lib/Sema/SemaDeclAttr.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclAttr.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index 6555a3d27fc..d302e40d7f0 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/lib/Sema/SemaDeclAttr.cpp
@@ -877,6 +877,7 @@ static void handleConsumableAttr(Sema &S, Decl *D, const AttributeList &Attr) {
Attr.getAttributeSpellingListIndex()));
}
+
static bool checkForConsumableClass(Sema &S, const CXXMethodDecl *MD,
const AttributeList &Attr) {
ASTContext &CurrContext = S.getASTContext();
@@ -4264,6 +4265,12 @@ static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D,
case AttributeList::AT_Consumable:
handleConsumableAttr(S, D, Attr);
break;
+ case AttributeList::AT_ConsumableAutoCast:
+ handleSimpleAttribute<ConsumableAutoCastAttr>(S, D, Attr); break;
+ break;
+ case AttributeList::AT_ConsumableSetOnRead:
+ handleSimpleAttribute<ConsumableSetOnReadAttr>(S, D, Attr); break;
+ break;
case AttributeList::AT_CallableWhen:
handleCallableWhenAttr(S, D, Attr);
break;
OpenPOWER on IntegriCloud