Skip to content

Commit

Permalink
Support DWARF address spaces in DIDerivedType
Browse files Browse the repository at this point in the history
Fixes #85.
  • Loading branch information
RyanGlScott committed Apr 10, 2023
1 parent fe44570 commit 3d5b2ac
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
;; Adapted from https://github.com/llvm/llvm-project/blob/d5561e0a0bbd484da17d3b68ae5fedc0a057246b/llvm/test/Assembler/debug-info.ll

!7 = !DIBasicType(tag: DW_TAG_base_type, name: "name", size: 1, align: 2, encoding: DW_ATE_unsigned_char)
!15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 32, align: 32, dwarfAddressSpace: 1)
2 changes: 1 addition & 1 deletion llvm-pretty
3 changes: 3 additions & 0 deletions src/Data/LLVM/BitCode/IR/Metadata.hs
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,9 @@ parseMetadataEntry vt mt pm (fromEntry -> Just r) =
<*> parseField r 9 numeric -- didtOffset
<*> parseField r 10 numeric -- didtFlags
<*> (mdForwardRefOrNull ctx mt <$> parseField r 11 numeric) -- didtExtraData
<*> (if length (recordFields r) <= 12
then pure Nothing
else Just <$> parseField r 12 numeric) -- didtDwarfAddressSpace
return $! updateMetadataTable
(addDebugInfo isDistinct (DebugInfoDerivedType didt)) pm

Expand Down

0 comments on commit 3d5b2ac

Please sign in to comment.