From f28bbec90e447b0960aab0a00993ea93ebe294ab Mon Sep 17 00:00:00 2001 From: DeLesley Hutchins Date: Tue, 14 Jan 2014 00:36:53 +0000 Subject: 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 --- clang/lib/Sema/SemaDeclAttr.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'clang/lib/Sema/SemaDeclAttr.cpp') 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(S, D, Attr); break; + break; + case AttributeList::AT_ConsumableSetOnRead: + handleSimpleAttribute(S, D, Attr); break; + break; case AttributeList::AT_CallableWhen: handleCallableWhenAttr(S, D, Attr); break; -- cgit v1.2.3