From 8f762bf5c40f89022c1da71f7c10fdfc64099d5d Mon Sep 17 00:00:00 2001 From: simonmar Date: Tue, 19 Dec 2000 13:06:50 +0000 Subject: [PATCH] [project @ 2000-12-19 13:06:50 by simonmar] - support -Rghc-timing in a bootstrapped compiler - support -H in compilers built with ghc 4.08+ --- ghc/compiler/main/DriverFlags.hs | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/ghc/compiler/main/DriverFlags.hs b/ghc/compiler/main/DriverFlags.hs index a7dd3ce..1f608dc 100644 --- a/ghc/compiler/main/DriverFlags.hs +++ b/ghc/compiler/main/DriverFlags.hs @@ -1,5 +1,7 @@ +{-# OPTIONS -#include "hschooks.h" #-} + ----------------------------------------------------------------------------- --- $Id: DriverFlags.hs,v 1.36 2000/12/19 12:36:12 sewardj Exp $ +-- $Id: DriverFlags.hs,v 1.37 2000/12/19 13:06:50 simonmar Exp $ -- -- Driver flags -- @@ -267,6 +269,7 @@ static_flags = ----- RTS opts ------------------------------------------------------ , ( "H" , HasArg (setHeapSize . fromIntegral . decodeSize) ) + , ( "Rghc-timing" , NoArg (enableTimingStats) ) ------ Compiler flags ----------------------------------------------- , ( "O2-for-C" , NoArg (writeIORef v_minus_o2_for_C True) ) @@ -476,15 +479,13 @@ decodeSize str pred c = isDigit c || c == '.' floatOpt :: IORef Double -> String -> IO () -floatOpt ref str - = writeIORef ref (read str :: Double) - -#if __GLASGOW_HASKELL__ >= 411 -foreign import "setHeapSize" unsafe setHeapSize :: Int -> IO () -#else -setHeapSize :: Int -> IO () -- -H is ignored -setHeapSize _ = return () -#endif +floatOpt ref str = writeIORef ref (read str :: Double) + +----------------------------------------------------------------------------- +-- RTS Hooks + +foreign import "setHeapSize" unsafe setHeapSize :: Int -> IO () +foreign import "enableTimingStats" unsafe enableTimingStats :: IO () ----------------------------------------------------------------------------- -- Build the Hsc static command line opts -- 1.7.10.4