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 crash:
http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/9718
Compiler error in unit test:
http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/9720
Unit test failure:
http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/9721
How does this differ from the one above it?