This patch also fixes a bug in FixedArrayStream. It used to trigger
an assert check if an array is empty.
Details
Diff Detail
Event Timeline
include/llvm/DebugInfo/CodeView/StreamArray.h | ||
---|---|---|
188 | I actually fixed this same bug in a patch that went in. So I guess you will have a merge conflict. I did it a little bit differently, but I guess both ways work. When you do merge, feel free to keep whichever you prefer. This way might be a little faster since it drops 2 conditionals from the ++ operator (although it has the downside that if you increment an iterator that is already at end, it will no longer compare equal to end. Not sure if we care, since incrementing end is already undefined behavior.) | |
include/llvm/DebugInfo/PDB/Raw/TpiStream.h | ||
33 | the first member of OffCb isn't necessarily a type index though, so I don't think this comment is entirely accurate. I'm guessing that in the Microsoft code they are using an OffCb structure parsing this hash table, but I guess that's just because the Offset field coincidentally has the same type as a type index. I think we should probably just delete the comment. Also, I've been putting structs like this in RawTypes.h so that they can be re-used from other code when we need them. | |
72 | I was doing this at first too, but I think some people had objections to overloading the << operator. I guess you should make a printTypeIndexOffset() function in llvm-pdbdump.cpp |
include/llvm/DebugInfo/CodeView/StreamArray.h | ||
---|---|---|
188 | I'm not an C++ expert, but I think in the first place we shouldn't increment an iterator that is already at end(). At least I believe if an iterator is a pointer pointing to a plain C array, the result of incrementing an iterator at end() is undefined. | |
include/llvm/DebugInfo/PDB/Raw/TpiStream.h | ||
33 | Will do. | |
72 | Will do. |
Looks good after rebasing and moving the print method
include/llvm/DebugInfo/CodeView/StreamArray.h | ||
---|---|---|
212 | Perhaps assert that Index < Array.size() instead. | |
tools/llvm-pdbdump/llvm-pdbdump.cpp | ||
618 | I think you will need to rebase and move this method to a pure virtual method on OutputStyle and implement it in LLVMOutputStyle. Sorry :-/ Good news is I should be done with all the intrusive changes now and can work in isolation entirely on the yaml outputter. |
I actually fixed this same bug in a patch that went in. So I guess you will have a merge conflict. I did it a little bit differently, but I guess both ways work. When you do merge, feel free to keep whichever you prefer. This way might be a little faster since it drops 2 conditionals from the ++ operator (although it has the downside that if you increment an iterator that is already at end, it will no longer compare equal to end. Not sure if we care, since incrementing end is already undefined behavior.)