module GHC.Platform.Profile
( Profile (..)
, profileBuildTag
, profileConstants
, profileIsProfiling
, profileWordSizeInBytes
)
where
import GHC.Prelude
import GHC.Platform
import GHC.Platform.Ways
data Profile = Profile
{ profilePlatform :: !Platform
, profileWays :: !Ways
}
profileConstants :: Profile -> PlatformConstants
profileConstants profile = platformConstants (profilePlatform profile)
profileIsProfiling :: Profile -> Bool
profileIsProfiling profile = profileWays profile `hasWay` WayProf
profileWordSizeInBytes :: Profile -> Int
profileWordSizeInBytes profile = platformWordSizeInBytes (profilePlatform profile)
profileBuildTag :: Profile -> String
profileBuildTag profile
| platformUnregisterised platform = 'u':wayTag
| otherwise = wayTag
where
platform = profilePlatform profile
wayTag = waysBuildTag (profileWays profile)