[PATCH] D19887: Move CodeViewTypeStream and iterators to DebugInfo/CodeView

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Tue May 3 14:57:59 PDT 2016


zturner added a comment.

In http://reviews.llvm.org/D19887#420489, @amccarth wrote:

> I'm not thrilled with the backsliding with respect to the parsing of the magic number.  The magic number is part of the format of the type stream, and the original intent was to abstract the parsing of the typestream so that multiple users didn't have to know about the details.  Now we're exposing this detail again and making the callers know that they have to pass a subset of the typestream to construct the iterators.
>
> Consider what happens in the future if there's a newer typestream format, and the indicator is in the magic number field.  This would completely break the abstraction.  The createCodeViewTypeStream function (which you removed) would probably have been a better place to handle the magic number).
>
> That said, I won't object because I know this is still a work in progress, so I'm confident we'll find the right level of abstraction eventually.


Well I guess what I'm finding is that the magic number is not part of the format of a codeview type stream, but rather part of the format of a `.debug$T` section of an object file.  I'm open to putting it somewhere else, but I think we need some kind of abstraction that simply iterates a raw sequence of types, since that's the lowest common denominator that all type stream containers hold.


http://reviews.llvm.org/D19887





More information about the llvm-commits mailing list