diff options
author | Ben Gamari <ben@smart-cactus.org> | 2017-09-15 19:14:02 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-09-15 19:42:04 -0400 |
commit | 6448322d7bc56c2b435b9bfda50430c0d0748a22 (patch) | |
tree | 32c5f411494fc58aa1cfecab2c08208ba62af0ad /compiler/llvmGen/Llvm/PpLlvm.hs | |
parent | fc2de303e0a53392d4ab987131608bc6bdbd81db (diff) | |
download | haskell-wip/llvm-debug-info.tar.gz |
Fix distinctionwip/llvm-debug-info
Diffstat (limited to 'compiler/llvmGen/Llvm/PpLlvm.hs')
-rw-r--r-- | compiler/llvmGen/Llvm/PpLlvm.hs | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/compiler/llvmGen/Llvm/PpLlvm.hs b/compiler/llvmGen/Llvm/PpLlvm.hs index 4a968cca3f..7a6aa631bf 100644 --- a/compiler/llvmGen/Llvm/PpLlvm.hs +++ b/compiler/llvmGen/Llvm/PpLlvm.hs @@ -106,14 +106,17 @@ ppLlvmMetas metas = vcat $ map ppLlvmMeta metas -- | Print out an LLVM metadata definition. ppLlvmMeta :: MetaDecl -> SDoc -ppLlvmMeta (MetaUnnamed n m) - = ppr n <+> equals <+> ppr m - -ppLlvmMeta (MetaNamed n m) - = exclamation <> ftext n <+> equals <+> exclamation <> braces nodes - where - nodes = hcat $ intersperse comma $ map ppr m - +ppLlvmMeta meta = + case meta of + MetaUnnamed n d m -> ppr n <+> equals <+> ppDistinction d <+> ppr m + MetaNamed n d m -> + let nodes = hcat $ intersperse comma $ map ppr m + in exclamation <> ftext n <+> equals + <+> ppDistinction d <+> exclamation <> braces nodes + +ppDistinction :: Distinction -> SDoc +ppDistinction Distinct = text "distinct" +ppDistinction NotDistinct = empty -- | Print out a list of function definitions. ppLlvmFunctions :: LlvmFunctions -> SDoc |