Revert "Batch merge"
[ghc.git] / compiler / utils / AsmUtils.hs
1 -- | Various utilities used in generating assembler.
2 --
3 -- These are used not only by the native code generator, but also by the
4 -- "DriverPipeline".
5 module AsmUtils
6 ( sectionType
7 ) where
8
9 import GhcPrelude
10
11 import Platform
12 import Outputable
13
14 -- | Generate a section type (e.g. @\@progbits@). See #13937.
15 sectionType :: String -- ^ section type
16 -> SDoc -- ^ pretty assembler fragment
17 sectionType ty = sdocWithPlatform $ \platform ->
18 case platformArch platform of
19 ArchARM{} -> char '%' <> text ty
20 _ -> char '@' <> text ty