Skip to content
Snippets Groups Projects
Commit 6c59cc71 authored by Stefan Schulze Frielinghaus's avatar Stefan Schulze Frielinghaus Committed by Marge Bot
Browse files

Fix endian handling of LLVM backend

Get rid of CPP macro WORDS_BIGENDIAN which is not defined anymore, and
replace it by DynFlag. This fixes partially #17337.
parent 3748ba3a
No related branches found
No related tags found
No related merge requests found
......@@ -843,8 +843,10 @@ ppDouble d
[x,y] -> [x,y]
_ -> error "dToStr: too many hex digits for float"
str = map toUpper $ concat $ fixEndian $ map hex bs
in text "0x" <> text str
in sdocWithDynFlags (\dflags ->
let fixEndian = if wORDS_BIGENDIAN dflags then id else reverse
str = map toUpper $ concat $ fixEndian $ map hex bs
in text "0x" <> text str)
-- Note [LLVM Float Types]
-- ~~~~~~~~~~~~~~~~~~~~~~~
......@@ -874,14 +876,6 @@ widenFp = float2Double
ppFloat :: Float -> SDoc
ppFloat = ppDouble . widenFp
-- | Reverse or leave byte data alone to fix endianness on this target.
fixEndian :: [a] -> [a]
#if defined(WORDS_BIGENDIAN)
fixEndian = id
#else
fixEndian = reverse
#endif
--------------------------------------------------------------------------------
-- * Misc functions
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment