llvm-pretty-bc-parser-0.4.1.0: LLVM bitcode parsing library
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.LLVM.Internal

Description

This module exports some internal modules *for use in testing only*.

Synopsis

Documentation

parseMetadataBlock Source #

Arguments

:: Int

globals seen so far

-> ValueTable 
-> [Entry] 
-> Parse ParsedMetadata 

parseMetadataKindEntry :: Record -> Parse () Source #

data PartialUnnamedMd Source #

Constructors

PartialUnnamedMd 

Fields

Instances

Instances details
Data PartialUnnamedMd Source # 
Instance details

Defined in Data.LLVM.BitCode.IR.Metadata

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PartialUnnamedMd -> c PartialUnnamedMd #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PartialUnnamedMd #

toConstr :: PartialUnnamedMd -> Constr #

dataTypeOf :: PartialUnnamedMd -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c PartialUnnamedMd) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PartialUnnamedMd) #

gmapT :: (forall b. Data b => b -> b) -> PartialUnnamedMd -> PartialUnnamedMd #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PartialUnnamedMd -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PartialUnnamedMd -> r #

gmapQ :: (forall d. Data d => d -> u) -> PartialUnnamedMd -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> PartialUnnamedMd -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> PartialUnnamedMd -> m PartialUnnamedMd #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PartialUnnamedMd -> m PartialUnnamedMd #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PartialUnnamedMd -> m PartialUnnamedMd #

Generic PartialUnnamedMd Source # 
Instance details

Defined in Data.LLVM.BitCode.IR.Metadata

Associated Types

type Rep PartialUnnamedMd :: Type -> Type #

Show PartialUnnamedMd Source # 
Instance details

Defined in Data.LLVM.BitCode.IR.Metadata

Eq PartialUnnamedMd Source # 
Instance details

Defined in Data.LLVM.BitCode.IR.Metadata

Ord PartialUnnamedMd Source # 
Instance details

Defined in Data.LLVM.BitCode.IR.Metadata

type Rep PartialUnnamedMd Source # 
Instance details

Defined in Data.LLVM.BitCode.IR.Metadata

finalizePValMd :: PValMd -> Finalize ValMd Source #

dedupMetadata :: Seq PartialUnnamedMd -> Seq PartialUnnamedMd Source #

This function generically traverses the given unnamed metadata values. When it encounters one with a PValMd inside of it, it looks up that value in the list. If found, it replaces the value with a reference to it.

Such de-duplication is necessary because the fallback of mdForwardRefOrNull is often called when it is in fact unnecessary, just because the appropriate references aren't available yet.

This function is concise at the cost of efficiency: In the worst case, every metadata node contains a reference to every other metadata node, and the cost is O(n^2*log(n)) where * n^2 comes from looking at every PValMd inside every PartialUnnamedMd * log(n) is the cost of looking them up in a Map.