Skip to content

Commit

Permalink
Add thisAdjustment and DIEnumerator
Browse files Browse the repository at this point in the history
  • Loading branch information
glguy committed Feb 21, 2017
1 parent 40f85fc commit 9ff4eb4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion llvm-pretty.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: llvm-pretty
Version: 0.5.0.0
Version: 0.6.0.0
License: BSD3
License-file: LICENSE
Author: Trevor Elliott
Expand Down
2 changes: 2 additions & 0 deletions src/Text/LLVM/AST.hs
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,7 @@ data DebugInfo' lab
| DebugInfoCompileUnit (DICompileUnit' lab)
| DebugInfoCompositeType (DICompositeType' lab)
| DebugInfoDerivedType (DIDerivedType' lab)
| DebugInfoEnumerator String !Int64
| DebugInfoExpression DIExpression
| DebugInfoFile DIFile
| DebugInfoGlobalVariable (DIGlobalVariable' lab)
Expand Down Expand Up @@ -1100,6 +1101,7 @@ data DISubprogram' lab = DISubprogram
, dispContainingType :: Maybe (ValMd' lab)
, dispVirtuality :: DwarfVirtuality
, dispVirtualIndex :: Word32
, dispThisAdjustment :: Int64
, dispFlags :: DIFlags
, dispIsOptimized :: Bool
, dispTemplateParams :: Maybe (ValMd' lab)
Expand Down
8 changes: 8 additions & 0 deletions src/Text/LLVM/PP.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import qualified Data.Map as Map
import Data.Maybe (catMaybes,fromMaybe)
import Numeric (showHex)
import Text.PrettyPrint.HughesPJ
import Data.Int


-- Pretty-printer Config -------------------------------------------------------
Expand Down Expand Up @@ -638,6 +639,7 @@ ppDebugInfo di = case di of
DebugInfoCompileUnit cu -> ppDICompileUnit cu
DebugInfoCompositeType ct -> ppDICompositeType ct
DebugInfoDerivedType dt -> ppDIDerivedType dt
DebugInfoEnumerator nm v -> ppDIEnumerator nm v
DebugInfoExpression e -> ppDIExpression e
DebugInfoFile f -> ppDIFile f
DebugInfoGlobalVariable gv -> ppDIGlobalVariable gv
Expand Down Expand Up @@ -714,6 +716,12 @@ ppDIDerivedType dt = "!DIDerivedType"
, (("extraData:" <+>) . ppValMd) <$> (didtExtraData dt)
])

ppDIEnumerator :: String -> Int64 -> Doc
ppDIEnumerator n v = "!DIEnumerator"
<> parens (commas [ "name:" <+> doubleQuotes (text n)
, "value:" <+> integral v
])

ppDIExpression :: DIExpression -> Doc
ppDIExpression e = "!DIExpression"
<> parens (commas (map integral (dieElements e)))
Expand Down

0 comments on commit 9ff4eb4

Please sign in to comment.