Skip to content

Commit

Permalink
parse subroutine type declaration formal parameters (#382)
Browse files Browse the repository at this point in the history
* parse subroutine type declaration formal parameters

This is useful for Reopt as we want to get more accurate type
information for library functions.
  • Loading branch information
Ptival authored May 22, 2024
1 parent 4b2f7df commit 77a6c62
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions base/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@
- The `Hashable` and `HashableF` instances for `App f` now require
`TestEquality f` constraints. (This is needed to support `hashable-1.4.*`,
which adds `Eq` as a superclass to `Hashable`.)

- `SubroutineTypeDecl` now contains a parsed `Variable` (rather than an unparsed `DIE`) for its
formals.
6 changes: 3 additions & 3 deletions base/src/Data/Macaw/Dwarf.hs
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ data EnumDecl = EnumDecl

data SubroutineTypeDecl = SubroutineTypeDecl
{ fntypePrototyped :: !(Maybe Bool),
fntypeFormals :: ![DIE],
fntypeFormals :: ![Variable],
fntypeType :: !(Maybe TypeRef)
}
deriving (Show)
Expand Down Expand Up @@ -837,9 +837,9 @@ parseEnumerationType fileVec = do

-- | Parse a subroutine type.
parseSubroutineType :: TypeParser
parseSubroutineType _ = do
parseSubroutineType fileVec = do
proto <- getMaybeAttribute DW_AT_prototyped attributeAsBool
formals <- parseChildrenList DW_TAG_formal_parameter pure
formals <- parseParameters fileVec

tp <- getMaybeAttribute DW_AT_type attributeAsTypeRef

Expand Down

0 comments on commit 77a6c62

Please sign in to comment.