-
-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for inlinee lines #47
Conversation
This is not yet complete, but will contain a full refactor of Symbols to fix #14. Additionally, this helps to expose binary annotations more neatly. |
c943d03
to
c2fe01d
Compare
52e8082
to
865a723
Compare
b5ad015
to
3767b59
Compare
Edit: Updated PR description. |
56972ac
to
91c5a67
Compare
* master: Fix clippy lints Add alignment tests Fix an invalid check when aligning buffers
@willglynn This is ready for review now. See #47 (comment) for a summary of all changes. |
When working on the next feature (Cross Module Imports/Exports), I realized that inlinees are probably better placed on the module info directly than the line program. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks! 🙌
Refactors symbol parsing, introduces support for inlinees and parsing of their binary annotations into line records.
Breaking Changes:
Symbol::name
has been removed, since not all symbols have a name. Instead, every symbol with a name now exposes aname
field. To provide uniform access to the name,SymbolData::name
now exposes anOption<RawString>
after parsing. (NB: This felt more robust than maintaining a manual list of offsets)SymbolData::Public
andSymbolData::Data
have been stripped of their*Symbol
prefix, as this is redundant and inconsistent.SymbolData::CompileFlags
, have been fixed with stronger typing.TypeIndex
is now a newtype aroundu32
, and so isIdIndex
. This is in preparation of supporting the IPI stream. I'm yet undecided whether to expose the IPI in a separate type or via directlyTypeFinder
.Public Changes:
Symbol::starts_scope
andSymbol::ends_scope
now indicate which symbols can contain sub-symbols. This helps to deal with a hierarchy of symbols, such as building a tree.Symbol
now exposes anindex
. Also, some symbols may refer to others via that index (e.g. inline sites point to theirparent
and theirend
).SymbolTable
,ModuleInfo
andSymbolIter
now allow jumping to symbols by their index.SymbolData::InlineSite(InlineSiteSymbol)
. It exposes an iterator over its binary annotations, which can be used to evaluate the line program of the inline site.LineProgram::inlinees
allows iteration over inlinees in a module. Each inlinee has aninlinee_lines
function that returns an iterator over line records evaluated from the binary annotations in the inline site symbol.Internal Changes:
Pread
is now implemented for more types, including:Variant
,CPUType
,SourceLanguage
.ParseBuffer
can now parse any type that implementsTryFromCtx
, not just the ones that usescroll::Endian
as context. There's also a new methodparse_with
to pass a custom parse context.SectionOffset
types now implementAddAssign
which has the same semantics asAdd
.Fixes #14