Adding role-based capability attributes that allow you to express role management: asserting a capability is held, acquiring a capability and releasing a capability. Also includes some skeleton documentation for these new attributes.
This functionality should be considered a WIP.
llvm-svn: 201890
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index e4967f8..d98a01d 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -12752,6 +12752,13 @@
else if (RequiresCapabilityAttr *RC
= dyn_cast<RequiresCapabilityAttr>(*A))
Args = ArrayRef<Expr *>(RC->args_begin(), RC->args_size());
+ else if (AcquireCapabilityAttr *AC = dyn_cast<AcquireCapabilityAttr>(*A))
+ Args = ArrayRef<Expr *>(AC->args_begin(), AC->args_size());
+ else if (TryAcquireCapabilityAttr *AC
+ = dyn_cast<TryAcquireCapabilityAttr>(*A))
+ Args = ArrayRef<Expr *>(AC->args_begin(), AC->args_size());
+ else if (ReleaseCapabilityAttr *RC = dyn_cast<ReleaseCapabilityAttr>(*A))
+ Args = ArrayRef<Expr *>(RC->args_begin(), RC->args_size());
if (Arg && !Finder.TraverseStmt(Arg))
return true;