diff options
Diffstat (limited to 'compiler/GHC/Platform/Profile.hs')
-rw-r--r-- | compiler/GHC/Platform/Profile.hs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/compiler/GHC/Platform/Profile.hs b/compiler/GHC/Platform/Profile.hs index d484a1ebc4..5875e5d56d 100644 --- a/compiler/GHC/Platform/Profile.hs +++ b/compiler/GHC/Platform/Profile.hs @@ -2,6 +2,9 @@ module GHC.Platform.Profile ( Profile (..) , profileBuildTag + , profileConstants + , profileIsProfiling + , profileWordSizeInBytes ) where @@ -23,6 +26,21 @@ data Profile = Profile , profileWays :: !(Set Way) -- ^ Ways } +-- | Get platform constants +profileConstants :: Profile -> PlatformConstants +{-# INLINE profileConstants #-} +profileConstants profile = platformConstants (profilePlatform profile) + +-- | Is profiling enabled +profileIsProfiling :: Profile -> Bool +{-# INLINE profileIsProfiling #-} +profileIsProfiling profile = profileWays profile `hasWay` WayProf + +-- | Word size in bytes +profileWordSizeInBytes :: Profile -> Int +{-# INLINE profileWordSizeInBytes #-} +profileWordSizeInBytes profile = platformWordSizeInBytes (profilePlatform profile) + -- | Unique build tag for the profile profileBuildTag :: Profile -> String profileBuildTag profile |