[LLVMdev] anchoring explicit template instantiations

David Blaikie dblaikie at gmail.com
Thu Dec 1 21:59:46 PST 2011

>> (that would still leave the need for a default in this switch because
>> one of the values of the enum isn't covered - ValueMask, but really
>> that probably shouldn't be one of the enumeration values anyway,
>> should it? (looks like it should just be a hidden constant somewhere
>> in the implementation details of llvm::Option))
> Why not add a case for ValueMask but not a default: ?

An unreachable case for ValueMask? Yeah, that'd be better than default.

Not exposing the mask values in the enums at all seems nicer, though -
so far as I can tell they're an implementation detail of llvm::Option.
- see the attached patch. (a bit of reworking inside Option flags to
avoid the need for masks entirely (though it does make the size of the
bitmasks fields "magic" based on the number of elements in each enum)
- but it makes the flags simpler so that they don't each have to use
bits beyond the previous one)

So I can do that, or just keep it the way it is & make a ValueMask
case with unreachable in it.

- David
-------------- next part --------------
A non-text attachment was scrubbed...
Name: option_masks.diff
Type: text/x-diff
Size: 17732 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111201/754e4344/attachment.diff>

More information about the llvm-dev mailing list