Page MenuHomePhabricator

Make CodeView TypeIterator generic so that it can iterate symbols too
ClosedPublic

Authored by zturner on May 6 2016, 3:46 PM.

Details

Summary

Symbol streams and type streams have the same format, and it's possible we might find other types of "things" that have similar formats as well. So rather than reproduce the code, we templatize TypeIterator on the type enumeration kind, and allow it to iterate over arbitrary streams of similarly laid out records.

Diff Detail

Repository
rL LLVM

Event Timeline

zturner updated this revision to Diff 56477.May 6 2016, 3:46 PM
zturner retitled this revision from to Make CodeView TypeIterator generic so that it can iterate symbols too.
zturner updated this object.
zturner added reviewers: rnk, amccarth.
zturner added a subscriber: llvm-commits.
amccarth edited edge metadata.May 6 2016, 3:57 PM

Nice refactor.

rnk accepted this revision.May 9 2016, 9:59 AM
rnk edited edge metadata.

lgtm

include/llvm/DebugInfo/CodeView/RecordIterator.h
20 ↗(On Diff #56477)

Maybe call the template parameter RecordKind or KindType so you can call the Record field Kind instead of Type?

113–114 ↗(On Diff #56477)

// end namespace codeview / llvm?

include/llvm/DebugInfo/CodeView/TypeRecord.h
275 ↗(On Diff #56477)

Once upon a type, TypeRecord was an actual class. With TypeRecordPrefix gone, the last vestiges of it are gone. Can you replace TypeRecord with "type record" here?

This revision is now accepted and ready to land.May 9 2016, 9:59 AM
This revision was automatically updated to reflect the committed changes.

Looks like this CL broke CMake buildbot - http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-cmake/builds/14464, could you take a look?

Someone beat me to the fix, case insensitive include path problem.

seurer added a subscriber: seurer.May 9 2016, 11:36 AM

I just noticed this problem on powerpc as well:

In file included from /home/seurer/llvm/llvm-test/include/llvm/DebugInfo/CodeView/SymbolRecord.h:14:0,

from /home/seurer/llvm/llvm-test/lib/MC/MCCodeView.cpp:19:

/home/seurer/llvm/llvm-test/include/llvm/DebugInfo/CodeView/RecordIterator.h:15:33: fatal error: llvm/support/Endian.h: No such file or directory

seurer@makalu-lp1:~/llvm/build/llvm-test$ find $LLVM_SRC -name Endian.h
/home/seurer/llvm/llvm-test/include/llvm/Support/Endian.h

Note "support" (incorrect) versus "Support" (correct).

Yea, sorry should be fixed in r268943. Let me know if it's not.