Export useful helpers from macaw-ppc

This includes another ELF helper to find function entry points and the
type-level tags to choose between the 32 and 64 bit architectures.
This commit is contained in:
Tristan Ravitch 2017-11-21 14:19:38 -08:00
parent d49dbc679c
commit 3b763bf347

View File

@ -10,8 +10,12 @@ module Data.Macaw.PPC (
-- * Macaw configurations
ppc32_linux_info,
ppc64_linux_info,
-- * Type-level tags
PPC64,
PPC32,
-- * ELF support
tocBaseForELF
tocBaseForELF,
tocEntryAddrsForElf
) where
import Data.Proxy ( Proxy(..) )
@ -43,10 +47,16 @@ import Data.Macaw.PPC.Arch ( rewriteTermStmt,
ppcPrimFnHasSideEffects,
PPCArchConstraints
)
import Data.Macaw.PPC.BinaryFormat.ELF ( tocBaseForELF )
import Data.Macaw.PPC.BinaryFormat.ELF ( tocBaseForELF, tocEntryAddrsForElf )
import qualified Data.Macaw.PPC.Semantics.PPC32 as PPC32
import qualified Data.Macaw.PPC.Semantics.PPC64 as PPC64
-- | The type tag for 64 bit PowerPC
type PPC64 = PPC64.PPC
-- | The type tag for 32 bit PowerPC
type PPC32 = PPC32.PPC
archDemandContext :: (PPCArchConstraints ppc) => proxy ppc -> MDS.DemandContext ppc ids
archDemandContext _ =
MDS.DemandContext { MDS.demandConstraints = \a -> a