From d8009416f9e0e067a19ee3e1a12e142488f3e62d Mon Sep 17 00:00:00 2001 From: Aaron Tomb Date: Fri, 27 Sep 2019 09:51:56 -0700 Subject: [PATCH] Add pretty-printing for new metadata fields --- src/Text/LLVM/PP.hs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Text/LLVM/PP.hs b/src/Text/LLVM/PP.hs index e01fc52..9c54291 100644 --- a/src/Text/LLVM/PP.hs +++ b/src/Text/LLVM/PP.hs @@ -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 @@ -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"