This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Split CTF parsing and type creation (NFC)
ClosedPublic

Authored by JDevlieghere on Jul 27 2023, 9:00 AM.

Details

Summary

Separate parsing CTF and creating LLDB types. This is a prerequisite to parsing forward references and recursive types.

Diff Detail

Event Timeline

JDevlieghere created this revision.Jul 27 2023, 9:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 27 2023, 9:00 AM
JDevlieghere requested review of this revision.Jul 27 2023, 9:00 AM
bulbazord added inline comments.Jul 27 2023, 10:43 AM
lldb/source/Plugins/SymbolFile/CTF/CTFTypes.h
2
10–11
102
lldb/source/Plugins/SymbolFile/CTF/SymbolFileCTF.cpp
932–935

Why do we return a Type * instead of a TypeSP?

JDevlieghere marked 4 inline comments as done.Jul 27 2023, 12:06 PM
JDevlieghere added inline comments.
lldb/source/Plugins/SymbolFile/CTF/CTFTypes.h
102

Clang format actually insists on this to fit it on one line.

lldb/source/Plugins/SymbolFile/CTF/SymbolFileCTF.cpp
932–935

The base method this overrides returns a Type*.

JDevlieghere marked 2 inline comments as done.
bulbazord accepted this revision.Jul 27 2023, 1:53 PM

Although I'm not super knowledgable about CTF, this kind of refactor makes sense. LGTM.

This revision is now accepted and ready to land.Jul 27 2023, 1:53 PM
Michael137 added inline comments.Jul 27 2023, 2:30 PM
lldb/source/Plugins/SymbolFile/CTF/CTFTypes.h
109

did you omit this by accident?

JDevlieghere marked an inline comment as done.Jul 27 2023, 2:31 PM
JDevlieghere added inline comments.
lldb/source/Plugins/SymbolFile/CTF/CTFTypes.h
109

Yes, good eye. I need to see why my test didn't catch this.

Michael137 added inline comments.Jul 27 2023, 2:33 PM
lldb/source/Plugins/SymbolFile/CTF/CTFTypes.h
109

(also to add to the suggestion, probably best to use this->values.size() in the assert below to avoid a use-after-move; not sure which values takes precedence)

This revision was automatically updated to reflect the committed changes.
JDevlieghere marked an inline comment as done.
Herald added a project: Restricted Project. · View Herald TranscriptJul 28 2023, 9:41 AM