macaw-symbolic: Consolidate duplicate definitions of toCrucibleEndian

There were two identical definitions of `toCrucibleEndian`, one in
`D.M.S.Memory` and another in `D.M.S.Testing`. This commit removes the
latter in favor of the former, which is actually exported.
This commit is contained in:
Ryan Scott 2022-01-04 14:32:19 -06:00 committed by Ryan Scott
parent c900dc4de8
commit 45f991ccdf
2 changed files with 2 additions and 9 deletions

View File

@ -174,7 +174,7 @@ data MemPtrTable sym w =
-- ^ Pointer width representative
}
-- | Convert a Macaw Endianness to a Crucible LLVM EndianForm
-- | Convert a Macaw 'MC.Endianness' to a Crucible LLVM 'CLD.EndianForm'.
toCrucibleEndian :: MC.Endianness -> CLD.EndianForm
toCrucibleEndian MC.BigEndian = CLD.BigEndian
toCrucibleEndian MC.LittleEndian = CLD.LittleEndian

View File

@ -233,7 +233,7 @@ simulateAndVerify goalSolver logger sym execFeatures archInfo archVals mem (Resu
halloc <- CFH.newHandleAllocator
CCC.SomeCFG g <- MS.mkFunCFG (MS.archFunctions archVals) halloc funName posFn dfi
let endianness = toCrucibleEndian (MAI.archEndianness archInfo)
let endianness = MSM.toCrucibleEndian (MAI.archEndianness archInfo)
let ?recordLLVMAnnotation = \_ _ _ -> return ()
(initMem, memPtrTbl) <- MSM.newGlobalMemory (Proxy @arch) sym endianness MSM.ConcreteMutable mem
let globalMap = MSM.mapRegionPointers memPtrTbl
@ -402,10 +402,3 @@ lookupSyscall = MS.unsupportedSyscalls "macaw-symbolic-tests"
-- parameter.
validityCheck :: MS.MkGlobalPointerValidityAssertion sym w
validityCheck _ _ _ _ = return Nothing
-- | Convert from macaw endianness to the LLVM memory model endianness
toCrucibleEndian :: MEL.Endianness -> CLD.EndianForm
toCrucibleEndian e =
case e of
MM.LittleEndian -> CLD.LittleEndian
MM.BigEndian -> CLD.BigEndian