Skip to content

Commit

Permalink
Add pretty-printing for new metadata fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Tomb committed Sep 27, 2019
1 parent d0574bb commit d800941
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Text/LLVM/PP.hs
Original file line number Diff line number Diff line change
Expand Up @@ -767,12 +767,13 @@ ppDebugLoc' pp dl = (if cfgUseDILocation ?config then "!DILocation"
<> parens (commas [ "line:" <+> integral (dlLine dl)
, "column:" <+> integral (dlCol dl)
, "scope:" <+> ppValMd' pp (dlScope dl)
] <+> mbIA)
] <> mbIA <> mbImplicit)

where
mbIA = case dlIA dl of
Just md -> comma <+> "inlinedAt:" <+> ppValMd' pp md
Nothing -> empty
mbImplicit = if dlImplicit dl then comma <+> "implicit" else empty

ppDebugLoc :: LLVM => DebugLoc -> Doc
ppDebugLoc = ppDebugLoc' ppLabel
Expand Down Expand Up @@ -913,7 +914,11 @@ ppDIBasicType bt = "!DIBasicType"
, "size:" <+> integral (dibtSize bt)
, "align:" <+> integral (dibtAlign bt)
, "encoding:" <+> integral (dibtEncoding bt)
])
] <> mbFlags)
where
mbFlags = case dibtFlags bt of
Just flags -> comma <+> "flags:" <+> integral flags
Nothing -> empty

ppDICompileUnit' :: LLVM => (i -> Doc) -> DICompileUnit' i -> Doc
ppDICompileUnit' pp cu = "!DICompileUnit"
Expand Down

0 comments on commit d800941

Please sign in to comment.