From 98fb72291474325f74ea055a1e006360fa753b8b Mon Sep 17 00:00:00 2001 From: Kevin Quick Date: Wed, 9 Aug 2023 16:38:49 -0700 Subject: [PATCH] Fix issue #124: do not emit DIDerivedType dwarfAddressSpace if the value is 0. --- src/Text/LLVM/PP.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Text/LLVM/PP.hs b/src/Text/LLVM/PP.hs index 0a9dfda..fd7b026 100644 --- a/src/Text/LLVM/PP.hs +++ b/src/Text/LLVM/PP.hs @@ -1107,7 +1107,10 @@ ppDIDerivedType' pp dt = "!DIDerivedType" , pure ("offset:" <+> integral (didtOffset dt)) , pure ("flags:" <+> integral (didtFlags dt)) , (("extraData:" <+>) . ppValMd' pp) <$> (didtExtraData dt) - , (("dwarfAddressSpace:" <+>) . integral) <$> didtDwarfAddressSpace dt + , case didtDwarfAddressSpace dt of + Nothing -> Nothing + Just 0 -> Nothing + Just s -> Just $ "dwarfAddressSpace:" <+> integral s , (("annotations:" <+>) . ppValMd' pp) <$> (didtAnnotations dt) ])