llvm-pretty-bc-parser 0.1.2.2 → 0.1.3.0
raw patch · 4 files changed
+28/−5 lines, 4 filesdep ~llvm-prettyPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: llvm-pretty
API changes (from Hackage documentation)
Files
- llvm-pretty-bc-parser.cabal +4/−4
- src/Data/LLVM/BitCode/IR/Function.hs +3/−0
- src/Data/LLVM/BitCode/IR/Module.hs +20/−1
- src/Data/LLVM/BitCode/Parse.hs +1/−0
llvm-pretty-bc-parser.cabal view
@@ -1,5 +1,5 @@ Name: llvm-pretty-bc-parser-Version: 0.1.2.2+Version: 0.1.3.0 License: BSD3 License-file: LICENSE Author: Trevor Elliott <trevor@galois.com>@@ -53,7 +53,7 @@ fgl >= 5.5, cereal >= 0.3.5.2, bytestring >= 0.9.1,- llvm-pretty>= 0.2.0.0+ llvm-pretty>= 0.3.0.0 Executable llvm-disasm Main-is: LLVMDis.hs@@ -69,7 +69,7 @@ fgl >= 5.5, fgl-visualize >= 0.1, cereal >= 0.3.5.2,- llvm-pretty>= 0.2.0.0,+ llvm-pretty>= 0.3.0.0, llvm-pretty-bc-parser Test-suite disasm-test@@ -82,5 +82,5 @@ directory, bytestring, filepath,- llvm-pretty>= 0.2.0.0,+ llvm-pretty>= 0.3.0.0, llvm-pretty-bc-parser
src/Data/LLVM/BitCode/IR/Function.hs view
@@ -83,6 +83,7 @@ -- bocks. data PartialDefine = PartialDefine { partialAttrs :: FunAttrs+ , partialSection :: Maybe String , partialRetType :: Type , partialName :: Symbol , partialArgs :: [Typed Ident]@@ -104,6 +105,7 @@ return PartialDefine { partialAttrs = protoAttrs proto+ , partialSection = protoSect proto , partialRetType = rty , partialName = Symbol (protoName proto) , partialArgs = zipWith Typed tys names@@ -176,6 +178,7 @@ , defArgs = partialArgs pd , defVarArgs = partialVarArgs pd , defBody = body+ , defSection = partialSection pd } -- | Individual label resolution step.
src/Data/LLVM/BitCode/IR/Module.hs view
@@ -16,7 +16,7 @@ import Data.LLVM.BitCode.Record import Text.LLVM.AST -import Control.Monad (foldM,guard)+import Control.Monad (foldM,guard,when) import Data.List (sortBy) import Data.Monoid (mempty) import Data.Ord (comparing)@@ -38,6 +38,7 @@ , partialAliases :: AliasList , partialNamedMd :: [NamedMd] , partialUnnamedMd :: [PartialUnnamedMd]+ , partialSections :: Seq.Seq String } emptyPartialModule :: PartialModule@@ -52,6 +53,7 @@ , partialAliases = mempty , partialNamedMd = mempty , partialUnnamedMd = mempty+ , partialSections = mempty } -- | Fixup the global variables and declarations, and return the completed@@ -201,6 +203,10 @@ return pm +parseModuleBlockEntry pm (moduleCodeSectionname -> Just r) = do+ name <- parseFields r 0 char+ return pm { partialSections = partialSections pm Seq.|> name }+ parseModuleBlockEntry _ e = fail ("unexpected: " ++ show e) @@ -213,6 +219,18 @@ link <- field 3 linkage + section <-+ if length (recordFields r) >= 6+ then do ix <- field 6 numeric+ if ix == 0+ then return Nothing+ else do let ix' = ix - 1+ when (ix' >= Seq.length (partialSections pm))+ (fail "invalid section name index")+ return (Just (Seq.index (partialSections pm) (ix - 1)))++ else return Nothing+ -- push the function type ix <- nextValueId name <- entryName ix@@ -229,6 +247,7 @@ } , protoName = name , protoIndex = ix+ , protoSect = section } if isProto == (0 :: Int)
src/Data/LLVM/BitCode/Parse.hs view
@@ -388,6 +388,7 @@ , protoAttrs :: FunAttrs , protoName :: String , protoIndex :: Int+ , protoSect :: Maybe String } deriving (Show) -- | Push a function prototype on to the prototype stack.