Looks like that with some minimal generalization of mapTag, we can
support inheritance in YAML I/O. In the new testcase I modified the
previous tagging example to actually store the underlying implementation
(decimal vs. fraction) in the YAML output.
I am thinking of using this pattern to produce the YAML output for
optimization remarks (see, https://reviews.llvm.org/D19678#419445). The
relevant part of the optimization remark hierarchy starts at
DiagnosticInfoOptimizationBase
(http://llvm.org/doxygen/classllvm_1_1DiagnosticInfoOptimizationBase.html)
I don't this is correct. If then output case, if the lambda returns false, that means the object being outputted is not of this tag type, and therefore mapTag() should return false.