Introduces ‘OptionSet’ in llvm/ADT headers, which is a utility class that makes it convenient to work with enumerators representing bit options.
We have found it useful in the swift repo where it originates. Apple owns the copyright on the entire file as posted for review and can thus relicense under the LLVM license.
For example of its usefulness, if accepted I intend to use OptionSet in clang code, for 'SymbolRoleSet' here: http://llvm.org/svn/llvm-project/cfe/trunk/include/clang/Index/IndexSymbol.h.
This will improve type safety and make the code more readable, avoiding all the 'unsigned' casts such as this:
Roles |= (unsigned)SymbolRole::Implicit;
MSVC 2013 had some trouble with the code and there are parts ifdef’ed out for MSVC 2013.
Aaron was kind enough to offer feedback on the MSVC issues.
Per Jordan, the static assert that gives trouble for MSVC is just an enforced style check.
The specific MSVC issues were:
Compiler error in unit test:
Unit test failure: