[PATCH] Logical expressions in capability attributes

Aaron Ballman aaron at aaronballman.com
Wed May 7 11:47:54 PDT 2014


This patch adds the ability to use logical expressions for capability
attributes. This is to allow requirements to be expressed not just in
terms of lists, but in terms of logical expressions. Eg)

void foo(void) __attribute__((requires_capability((FlightControl ||
Worker) && !Logger)));

This functionality is lowered from an Expr into an LExpr (logical
expression) which we can then perform Boolean implication on to
determine whether the capability context satisfies the logical
expression.

It does not hook this functionality into the existing capability
analyses because that is a considerably larger chunk of code to be
implemented in a subsequent patch. Like ThreadSafetyTIL.cpp/h, this is
WIP code.

~Aaron
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Caps3.patch
Type: application/octet-stream
Size: 11258 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140507/006d8e96/attachment.obj>


More information about the cfe-commits mailing list