From 45f991ccdf0e7bda40e9b4772cd958ba5f797aba Mon Sep 17 00:00:00 2001 From: Ryan Scott Date: Tue, 4 Jan 2022 14:32:19 -0600 Subject: [PATCH] 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. --- symbolic/src/Data/Macaw/Symbolic/Memory.hs | 2 +- symbolic/src/Data/Macaw/Symbolic/Testing.hs | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/symbolic/src/Data/Macaw/Symbolic/Memory.hs b/symbolic/src/Data/Macaw/Symbolic/Memory.hs index dc8ff3c0..a9f6aace 100644 --- a/symbolic/src/Data/Macaw/Symbolic/Memory.hs +++ b/symbolic/src/Data/Macaw/Symbolic/Memory.hs @@ -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 diff --git a/symbolic/src/Data/Macaw/Symbolic/Testing.hs b/symbolic/src/Data/Macaw/Symbolic/Testing.hs index 87e9d954..1e6ca8e1 100644 --- a/symbolic/src/Data/Macaw/Symbolic/Testing.hs +++ b/symbolic/src/Data/Macaw/Symbolic/Testing.hs @@ -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