llvm-pretty-0.11.0: A pretty printing library inspired by the llvm binding.

LicenseBSD3
Stabilityprovisional
Safe HaskellNone
LanguageHaskell2010

Text.LLVM.DebugUtils

Contents

Description

Point-of-contact : emertens

Synopsis

Definition type analyzer

data Info Source #

Constructors

Pointer Info 
Structure [(String, Word64, Info)]

Fields: name, bit-offset, info

Union [(String, Info)] 
ArrInfo Info 
BaseType String 
Unknown 
Instances
Show Info Source # 
Instance details

Defined in Text.LLVM.DebugUtils

Methods

showsPrec :: Int -> Info -> ShowS #

show :: Info -> String #

showList :: [Info] -> ShowS #

computeFunctionTypes Source #

Arguments

:: Module

module to search

-> Symbol

function symbol

-> Maybe [Info]

return and argument type information

Compute the structures of a function's return and argument types using DWARF information metadata of the LLVM module. Different versions of LLVM make this information available via different paths. This function attempts to support the variations.

valMdToInfo :: MdMap -> ValMd -> Info Source #

localVariableNameDeclarations Source #

Arguments

:: IntMap ValMd

unnamed metadata

-> Define

function definition

-> Map Ident Ident

raw name, actual name

Metadata lookup

mkMdMap :: Module -> IntMap ValMd Source #

Compute an IntMap of the unnamed metadata in a module

Type structure dereference

derefInfo Source #

Arguments

:: Info

pointer type information

-> Info

type information of pointer's base type

If the argument describes a pointer, return the information for the type that it points do. If the argument describes an array, return information about the element type.

fieldIndexByPosition Source #

Arguments

:: Int

zero-based field index

-> Info

composite type information

-> Info

type information for specified field

If the argument describes a composite type, returns the type of the field by zero-based index into the list of fields.

fieldIndexByName Source #

Arguments

:: String

field name

-> Info

composite type info

-> Maybe Int

zero-based index of field matching the name

If the argument describes a composite type, return the first, zero-based index of the field in that type that matches the given name.

Info hueristics

guessAliasInfo Source #

Arguments

:: IntMap ValMd

unnamed metadata

-> Ident

alias

-> Info 

Search the metadata for debug info corresponding to a given type alias. This is considered a heuristic because there's no direct mapping between type aliases and debug info. The debug information must be search for a textual match.