summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsdiehl <>2019-08-13 10:38:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2019-08-13 10:38:00 (GMT)
commit090635ed7e926f99d015e7419f66a65a925157d2 (patch)
treef133cb9991feef96d801ac87d1b47b42a2144cd6
parent2d9b1ae4f66e54b3695e7b81827442c2d0a070f4 (diff)
version 0.6.2.0HEAD0.6.2.0master
-rw-r--r--llvm-hs-pretty.cabal8
-rw-r--r--src/LLVM/Pretty.hs25
2 files changed, 27 insertions, 6 deletions
diff --git a/llvm-hs-pretty.cabal b/llvm-hs-pretty.cabal
index 184eeee..b42a305 100644
--- a/llvm-hs-pretty.cabal
+++ b/llvm-hs-pretty.cabal
@@ -1,5 +1,5 @@
name: llvm-hs-pretty
-version: 0.6.1.0
+version: 0.6.2.0
license: MIT
synopsis: A pretty printer for LLVM IR.
description: A pretty printer for the LLVM AST types provided by llvm-hs.
@@ -29,7 +29,7 @@ library
array >= 0.5,
base >= 4.6 && < 5.0,
bytestring >= 0.10,
- llvm-hs-pure >= 7.0,
+ llvm-hs-pure >= 8.0,
text >= 0.1,
prettyprinter >= 1.2
@@ -50,5 +50,5 @@ Test-suite test
tasty-hunit -any,
tasty-golden >= 1.1,
llvm-hs-pretty -any,
- llvm-hs >= 7.0,
- llvm-hs-pure >= 7.0
+ llvm-hs >= 8.0,
+ llvm-hs-pure >= 8.0
diff --git a/src/LLVM/Pretty.hs b/src/LLVM/Pretty.hs
index 30f8449..ddc6c53 100644
--- a/src/LLVM/Pretty.hs
+++ b/src/LLVM/Pretty.hs
@@ -652,6 +652,17 @@ ppDWOp o = case o of
DW_OP_Mul -> ["DW_OP_mul"]
DW_OP_Deref -> ["DW_OP_deref"]
DW_OP_XDeref -> ["DW_OP_xderef"]
+ DW_OP_Lit0 -> ["DW_OP_Lit0"]
+ DW_OP_Div -> ["DW_OP_Div"]
+ DW_OP_Mod -> ["DW_OP_Mod"]
+ DW_OP_Not -> ["DW_OP_Not"]
+ DW_OP_Or -> ["DW_OP_Or"]
+ DW_OP_Xor -> ["DW_OP_Xor"]
+ DW_OP_And -> ["DW_OP_And"]
+ DW_OP_Shr -> ["DW_OP_Shr"]
+ DW_OP_Shra -> ["DW_OP_Shra"]
+ DW_OP_Shl -> ["DW_OP_Shl"]
+ DW_OP_Dup -> ["DW_OP_Dup"]
instance Pretty DIGlobalVariableExpression where
pretty e = ppDINode "DIGlobalVariableExpression"
@@ -773,7 +784,8 @@ instance Pretty DICompileUnit where
, ("dwoId", Just (pretty dWOId))
, ("splitDebugInlining", Just (ppBoolean splitDebugInlining))
, ("debugInfoForProfiling", Just (ppBoolean debugInfoForProfiling))
- , ("gnuPubnames", Just (ppBoolean gnuPubnames))
+ , ("nameTableKind", Just (pretty nameTableKind))
+ , ("debugBaseAddress", Just (ppBoolean debugBaseAddress))
]
instance Pretty DebugEmissionKind where
@@ -880,6 +892,7 @@ instance Pretty Encoding where
pretty e = case e of
AddressEncoding -> "DW_ATE_address"
BooleanEncoding -> "DW_ATE_boolean"
+ UTFEncoding -> "DW_ATE_UTF"
FloatEncoding -> "DW_ATE_float"
SignedEncoding -> "DW_ATE_signed"
SignedCharEncoding -> "DW_ATE_signed_char"
@@ -1202,6 +1215,12 @@ instance Pretty RMW.RMWOperation where
instance Pretty DataLayout where
pretty x = pretty (BL.unpack (dataLayoutToString x))
+instance Pretty DebugNameTableKind where
+ pretty = \case
+ NameTableKindDefault -> "Default"
+ NameTableKindGNU -> "GNU"
+ NameTableKindNone -> "None"
+
-- -------------------------------------------------------------------------------
-- -- Special Case Hacks
-- -------------------------------------------------------------------------------
@@ -1262,7 +1281,9 @@ ppCall Call { function = Right f,..}
= tail <+> "call" <+> pretty callingConvention <+> ppReturnAttributes returnAttributes <+> pretty resultType <+> ftype
<+> pretty f <> parens (commas $ fmap ppArguments arguments) <+> ppFunctionAttributes functionAttributes
where
- (functionType@FunctionType {..}) = referencedType (typeOf f)
+ (functionType@FunctionType {..}) = case (referencedType (typeOf f)) of
+ fty@FunctionType {..} -> fty
+ _ -> error "Calling non function type"
ftype = if isVarArg
then ppFunctionArgumentTypes functionType
else mempty