diff options
Diffstat (limited to 'includes')
-rw-r--r-- | includes/Cmm.h | 18 | ||||
-rw-r--r-- | includes/CodeGen.Platform.hs | 410 | ||||
-rw-r--r-- | includes/HsFFI.h | 4 | ||||
-rw-r--r-- | includes/MachDeps.h | 4 | ||||
-rw-r--r-- | includes/Rts.h | 30 | ||||
-rw-r--r-- | includes/RtsAPI.h | 6 | ||||
-rw-r--r-- | includes/Stg.h | 6 | ||||
-rw-r--r-- | includes/rts/EventLogFormat.h | 2 | ||||
-rw-r--r-- | includes/rts/Flags.h | 2 | ||||
-rw-r--r-- | includes/rts/OSThreads.h | 14 | ||||
-rw-r--r-- | includes/rts/Threads.h | 2 | ||||
-rw-r--r-- | includes/rts/prof/LDV.h | 4 | ||||
-rw-r--r-- | includes/rts/storage/Block.h | 12 | ||||
-rw-r--r-- | includes/rts/storage/ClosureMacros.h | 8 | ||||
-rw-r--r-- | includes/rts/storage/Closures.h | 4 | ||||
-rw-r--r-- | includes/rts/storage/InfoTables.h | 24 | ||||
-rw-r--r-- | includes/rts/storage/MBlock.h | 2 | ||||
-rw-r--r-- | includes/rts/storage/TSO.h | 6 | ||||
-rw-r--r-- | includes/stg/DLL.h | 4 | ||||
-rw-r--r-- | includes/stg/HaskellMachRegs.h | 14 | ||||
-rw-r--r-- | includes/stg/MachRegs.h | 18 | ||||
-rw-r--r-- | includes/stg/MiscClosures.h | 6 | ||||
-rw-r--r-- | includes/stg/RtsMachRegs.h | 18 | ||||
-rw-r--r-- | includes/stg/Ticky.h | 6 |
24 files changed, 312 insertions, 312 deletions
diff --git a/includes/Cmm.h b/includes/Cmm.h index 3c90307a77..57d78ccaa5 100644 --- a/includes/Cmm.h +++ b/includes/Cmm.h @@ -120,13 +120,13 @@ name : bits8[] str; \ } \ -#ifdef TABLES_NEXT_TO_CODE +#if defined(TABLES_NEXT_TO_CODE) #define RET_LBL(f) f##_info #else #define RET_LBL(f) f##_ret #endif -#ifdef TABLES_NEXT_TO_CODE +#if defined(TABLES_NEXT_TO_CODE) #define ENTRY_LBL(f) f##_info #else #define ENTRY_LBL(f) f##_entry @@ -204,7 +204,7 @@ Assertions and Debuggery -------------------------------------------------------------------------- */ -#ifdef DEBUG +#if defined(DEBUG) #define ASSERT(predicate) \ if (predicate) { \ /*null*/; \ @@ -215,7 +215,7 @@ #define ASSERT(p) /* nothing */ #endif -#ifdef DEBUG +#if defined(DEBUG) #define DEBUG_ONLY(s) s #else #define DEBUG_ONLY(s) /* nothing */ @@ -230,7 +230,7 @@ * * Note the syntax is slightly different to the C version of this macro. */ -#ifdef DEBUG +#if defined(DEBUG) #define IF_DEBUG(c,s) if (RtsFlags_DebugFlags_##c(RtsFlags) != 0::CBool) { s; } #else #define IF_DEBUG(c,s) /* nothing */ @@ -256,7 +256,7 @@ Indirections can contain tagged pointers, so their tag is checked. -------------------------------------------------------------------------- */ -#ifdef PROFILING +#if defined(PROFILING) // When profiling, we cannot shortcut ENTER() by checking the tag, // because LDV profiling relies on entering closures to mark them as @@ -589,7 +589,7 @@ * depending on TABLES_NEXT_TO_CODE. So we define field access * macros which use the appropriate version here: */ -#ifdef TABLES_NEXT_TO_CODE +#if defined(TABLES_NEXT_TO_CODE) /* * when TABLES_NEXT_TO_CODE, slow_apply is stored as an offset * instead of the normal pointer. @@ -623,7 +623,7 @@ #define OVERWRITING_CLOSURE_OFS(c,n) /* nothing */ #endif -#ifdef THREADED_RTS +#if defined(THREADED_RTS) #define prim_write_barrier prim %write_barrier() #else #define prim_write_barrier /* nothing */ @@ -633,7 +633,7 @@ Ticky macros -------------------------------------------------------------------------- */ -#ifdef TICKY_TICKY +#if defined(TICKY_TICKY) #define TICK_BUMP_BY(ctr,n) CLong[ctr] = CLong[ctr] + n #else #define TICK_BUMP_BY(ctr,n) /* nothing */ diff --git a/includes/CodeGen.Platform.hs b/includes/CodeGen.Platform.hs index 97628aecdc..868608a1ed 100644 --- a/includes/CodeGen.Platform.hs +++ b/includes/CodeGen.Platform.hs @@ -352,278 +352,278 @@ import Reg #endif callerSaves :: GlobalReg -> Bool -#ifdef CALLER_SAVES_Base +#if defined(CALLER_SAVES_Base) callerSaves BaseReg = True #endif -#ifdef CALLER_SAVES_R1 +#if defined(CALLER_SAVES_R1) callerSaves (VanillaReg 1 _) = True #endif -#ifdef CALLER_SAVES_R2 +#if defined(CALLER_SAVES_R2) callerSaves (VanillaReg 2 _) = True #endif -#ifdef CALLER_SAVES_R3 +#if defined(CALLER_SAVES_R3) callerSaves (VanillaReg 3 _) = True #endif -#ifdef CALLER_SAVES_R4 +#if defined(CALLER_SAVES_R4) callerSaves (VanillaReg 4 _) = True #endif -#ifdef CALLER_SAVES_R5 +#if defined(CALLER_SAVES_R5) callerSaves (VanillaReg 5 _) = True #endif -#ifdef CALLER_SAVES_R6 +#if defined(CALLER_SAVES_R6) callerSaves (VanillaReg 6 _) = True #endif -#ifdef CALLER_SAVES_R7 +#if defined(CALLER_SAVES_R7) callerSaves (VanillaReg 7 _) = True #endif -#ifdef CALLER_SAVES_R8 +#if defined(CALLER_SAVES_R8) callerSaves (VanillaReg 8 _) = True #endif -#ifdef CALLER_SAVES_R9 +#if defined(CALLER_SAVES_R9) callerSaves (VanillaReg 9 _) = True #endif -#ifdef CALLER_SAVES_R10 +#if defined(CALLER_SAVES_R10) callerSaves (VanillaReg 10 _) = True #endif -#ifdef CALLER_SAVES_F1 +#if defined(CALLER_SAVES_F1) callerSaves (FloatReg 1) = True #endif -#ifdef CALLER_SAVES_F2 +#if defined(CALLER_SAVES_F2) callerSaves (FloatReg 2) = True #endif -#ifdef CALLER_SAVES_F3 +#if defined(CALLER_SAVES_F3) callerSaves (FloatReg 3) = True #endif -#ifdef CALLER_SAVES_F4 +#if defined(CALLER_SAVES_F4) callerSaves (FloatReg 4) = True #endif -#ifdef CALLER_SAVES_F5 +#if defined(CALLER_SAVES_F5) callerSaves (FloatReg 5) = True #endif -#ifdef CALLER_SAVES_F6 +#if defined(CALLER_SAVES_F6) callerSaves (FloatReg 6) = True #endif -#ifdef CALLER_SAVES_D1 +#if defined(CALLER_SAVES_D1) callerSaves (DoubleReg 1) = True #endif -#ifdef CALLER_SAVES_D2 +#if defined(CALLER_SAVES_D2) callerSaves (DoubleReg 2) = True #endif -#ifdef CALLER_SAVES_D3 +#if defined(CALLER_SAVES_D3) callerSaves (DoubleReg 3) = True #endif -#ifdef CALLER_SAVES_D4 +#if defined(CALLER_SAVES_D4) callerSaves (DoubleReg 4) = True #endif -#ifdef CALLER_SAVES_D5 +#if defined(CALLER_SAVES_D5) callerSaves (DoubleReg 5) = True #endif -#ifdef CALLER_SAVES_D6 +#if defined(CALLER_SAVES_D6) callerSaves (DoubleReg 6) = True #endif -#ifdef CALLER_SAVES_L1 +#if defined(CALLER_SAVES_L1) callerSaves (LongReg 1) = True #endif -#ifdef CALLER_SAVES_Sp +#if defined(CALLER_SAVES_Sp) callerSaves Sp = True #endif -#ifdef CALLER_SAVES_SpLim +#if defined(CALLER_SAVES_SpLim) callerSaves SpLim = True #endif -#ifdef CALLER_SAVES_Hp +#if defined(CALLER_SAVES_Hp) callerSaves Hp = True #endif -#ifdef CALLER_SAVES_HpLim +#if defined(CALLER_SAVES_HpLim) callerSaves HpLim = True #endif -#ifdef CALLER_SAVES_CCCS +#if defined(CALLER_SAVES_CCCS) callerSaves CCCS = True #endif -#ifdef CALLER_SAVES_CurrentTSO +#if defined(CALLER_SAVES_CurrentTSO) callerSaves CurrentTSO = True #endif -#ifdef CALLER_SAVES_CurrentNursery +#if defined(CALLER_SAVES_CurrentNursery) callerSaves CurrentNursery = True #endif callerSaves _ = False activeStgRegs :: [GlobalReg] activeStgRegs = [ -#ifdef REG_Base +#if defined(REG_Base) BaseReg #endif -#ifdef REG_Sp +#if defined(REG_Sp) ,Sp #endif -#ifdef REG_Hp +#if defined(REG_Hp) ,Hp #endif -#ifdef REG_R1 +#if defined(REG_R1) ,VanillaReg 1 VGcPtr #endif -#ifdef REG_R2 +#if defined(REG_R2) ,VanillaReg 2 VGcPtr #endif -#ifdef REG_R3 +#if defined(REG_R3) ,VanillaReg 3 VGcPtr #endif -#ifdef REG_R4 +#if defined(REG_R4) ,VanillaReg 4 VGcPtr #endif -#ifdef REG_R5 +#if defined(REG_R5) ,VanillaReg 5 VGcPtr #endif -#ifdef REG_R6 +#if defined(REG_R6) ,VanillaReg 6 VGcPtr #endif -#ifdef REG_R7 +#if defined(REG_R7) ,VanillaReg 7 VGcPtr #endif -#ifdef REG_R8 +#if defined(REG_R8) ,VanillaReg 8 VGcPtr #endif -#ifdef REG_R9 +#if defined(REG_R9) ,VanillaReg 9 VGcPtr #endif -#ifdef REG_R10 +#if defined(REG_R10) ,VanillaReg 10 VGcPtr #endif -#ifdef REG_SpLim +#if defined(REG_SpLim) ,SpLim #endif #if MAX_REAL_XMM_REG != 0 -#ifdef REG_F1 +#if defined(REG_F1) ,FloatReg 1 #endif -#ifdef REG_D1 +#if defined(REG_D1) ,DoubleReg 1 #endif -#ifdef REG_XMM1 +#if defined(REG_XMM1) ,XmmReg 1 #endif -#ifdef REG_YMM1 +#if defined(REG_YMM1) ,YmmReg 1 #endif -#ifdef REG_ZMM1 +#if defined(REG_ZMM1) ,ZmmReg 1 #endif -#ifdef REG_F2 +#if defined(REG_F2) ,FloatReg 2 #endif -#ifdef REG_D2 +#if defined(REG_D2) ,DoubleReg 2 #endif -#ifdef REG_XMM2 +#if defined(REG_XMM2) ,XmmReg 2 #endif -#ifdef REG_YMM2 +#if defined(REG_YMM2) ,YmmReg 2 #endif -#ifdef REG_ZMM2 +#if defined(REG_ZMM2) ,ZmmReg 2 #endif -#ifdef REG_F3 +#if defined(REG_F3) ,FloatReg 3 #endif -#ifdef REG_D3 +#if defined(REG_D3) ,DoubleReg 3 #endif -#ifdef REG_XMM3 +#if defined(REG_XMM3) ,XmmReg 3 #endif -#ifdef REG_YMM3 +#if defined(REG_YMM3) ,YmmReg 3 #endif -#ifdef REG_ZMM3 +#if defined(REG_ZMM3) ,ZmmReg 3 #endif -#ifdef REG_F4 +#if defined(REG_F4) ,FloatReg 4 #endif -#ifdef REG_D4 +#if defined(REG_D4) ,DoubleReg 4 #endif -#ifdef REG_XMM4 +#if defined(REG_XMM4) ,XmmReg 4 #endif -#ifdef REG_YMM4 +#if defined(REG_YMM4) ,YmmReg 4 #endif -#ifdef REG_ZMM4 +#if defined(REG_ZMM4) ,ZmmReg 4 #endif -#ifdef REG_F5 +#if defined(REG_F5) ,FloatReg 5 #endif -#ifdef REG_D5 +#if defined(REG_D5) ,DoubleReg 5 #endif -#ifdef REG_XMM5 +#if defined(REG_XMM5) ,XmmReg 5 #endif -#ifdef REG_YMM5 +#if defined(REG_YMM5) ,YmmReg 5 #endif -#ifdef REG_ZMM5 +#if defined(REG_ZMM5) ,ZmmReg 5 #endif -#ifdef REG_F6 +#if defined(REG_F6) ,FloatReg 6 #endif -#ifdef REG_D6 +#if defined(REG_D6) ,DoubleReg 6 #endif -#ifdef REG_XMM6 +#if defined(REG_XMM6) ,XmmReg 6 #endif -#ifdef REG_YMM6 +#if defined(REG_YMM6) ,YmmReg 6 #endif -#ifdef REG_ZMM6 +#if defined(REG_ZMM6) ,ZmmReg 6 #endif #else /* MAX_REAL_XMM_REG == 0 */ -#ifdef REG_F1 +#if defined(REG_F1) ,FloatReg 1 #endif -#ifdef REG_F2 +#if defined(REG_F2) ,FloatReg 2 #endif -#ifdef REG_F3 +#if defined(REG_F3) ,FloatReg 3 #endif -#ifdef REG_F4 +#if defined(REG_F4) ,FloatReg 4 #endif -#ifdef REG_F5 +#if defined(REG_F5) ,FloatReg 5 #endif -#ifdef REG_F6 +#if defined(REG_F6) ,FloatReg 6 #endif -#ifdef REG_D1 +#if defined(REG_D1) ,DoubleReg 1 #endif -#ifdef REG_D2 +#if defined(REG_D2) ,DoubleReg 2 #endif -#ifdef REG_D3 +#if defined(REG_D3) ,DoubleReg 3 #endif -#ifdef REG_D4 +#if defined(REG_D4) ,DoubleReg 4 #endif -#ifdef REG_D5 +#if defined(REG_D5) ,DoubleReg 5 #endif -#ifdef REG_D6 +#if defined(REG_D6) ,DoubleReg 6 #endif #endif /* MAX_REAL_XMM_REG == 0 */ ] haveRegBase :: Bool -#ifdef REG_Base +#if defined(REG_Base) haveRegBase = True #else haveRegBase = False @@ -636,58 +636,58 @@ globalRegMaybe :: GlobalReg -> Maybe RealReg #if defined(MACHREGS_i386) || defined(MACHREGS_x86_64) \ || defined(MACHREGS_sparc) || defined(MACHREGS_powerpc) \ || defined(MACHREGS_arm) || defined(MACHREGS_aarch64) -# ifdef REG_Base +# if defined(REG_Base) globalRegMaybe BaseReg = Just (RealRegSingle REG_Base) # endif -# ifdef REG_R1 +# if defined(REG_R1) globalRegMaybe (VanillaReg 1 _) = Just (RealRegSingle REG_R1) # endif -# ifdef REG_R2 +# if defined(REG_R2) globalRegMaybe (VanillaReg 2 _) = Just (RealRegSingle REG_R2) # endif -# ifdef REG_R3 +# if defined(REG_R3) globalRegMaybe (VanillaReg 3 _) = Just (RealRegSingle REG_R3) # endif -# ifdef REG_R4 +# if defined(REG_R4) globalRegMaybe (VanillaReg 4 _) = Just (RealRegSingle REG_R4) # endif -# ifdef REG_R5 +# if defined(REG_R5) globalRegMaybe (VanillaReg 5 _) = Just (RealRegSingle REG_R5) # endif -# ifdef REG_R6 +# if defined(REG_R6) globalRegMaybe (VanillaReg 6 _) = Just (RealRegSingle REG_R6) # endif -# ifdef REG_R7 +# if defined(REG_R7) globalRegMaybe (VanillaReg 7 _) = Just (RealRegSingle REG_R7) # endif -# ifdef REG_R8 +# if defined(REG_R8) globalRegMaybe (VanillaReg 8 _) = Just (RealRegSingle REG_R8) # endif -# ifdef REG_R9 +# if defined(REG_R9) globalRegMaybe (VanillaReg 9 _) = Just (RealRegSingle REG_R9) # endif -# ifdef REG_R10 +# if defined(REG_R10) globalRegMaybe (VanillaReg 10 _) = Just (RealRegSingle REG_R10) # endif -# ifdef REG_F1 +# if defined(REG_F1) globalRegMaybe (FloatReg 1) = Just (RealRegSingle REG_F1) # endif -# ifdef REG_F2 +# if defined(REG_F2) globalRegMaybe (FloatReg 2) = Just (RealRegSingle REG_F2) # endif -# ifdef REG_F3 +# if defined(REG_F3) globalRegMaybe (FloatReg 3) = Just (RealRegSingle REG_F3) # endif -# ifdef REG_F4 +# if defined(REG_F4) globalRegMaybe (FloatReg 4) = Just (RealRegSingle REG_F4) # endif -# ifdef REG_F5 +# if defined(REG_F5) globalRegMaybe (FloatReg 5) = Just (RealRegSingle REG_F5) # endif -# ifdef REG_F6 +# if defined(REG_F6) globalRegMaybe (FloatReg 6) = Just (RealRegSingle REG_F6) # endif -# ifdef REG_D1 +# if defined(REG_D1) globalRegMaybe (DoubleReg 1) = # if defined(MACHREGS_sparc) Just (RealRegPair REG_D1 (REG_D1 + 1)) @@ -695,7 +695,7 @@ globalRegMaybe (DoubleReg 1) = Just (RealRegSingle REG_D1) # endif # endif -# ifdef REG_D2 +# if defined(REG_D2) globalRegMaybe (DoubleReg 2) = # if defined(MACHREGS_sparc) Just (RealRegPair REG_D2 (REG_D2 + 1)) @@ -703,7 +703,7 @@ globalRegMaybe (DoubleReg 2) = Just (RealRegSingle REG_D2) # endif # endif -# ifdef REG_D3 +# if defined(REG_D3) globalRegMaybe (DoubleReg 3) = # if defined(MACHREGS_sparc) Just (RealRegPair REG_D3 (REG_D3 + 1)) @@ -711,7 +711,7 @@ globalRegMaybe (DoubleReg 3) = Just (RealRegSingle REG_D3) # endif # endif -# ifdef REG_D4 +# if defined(REG_D4) globalRegMaybe (DoubleReg 4) = # if defined(MACHREGS_sparc) Just (RealRegPair REG_D4 (REG_D4 + 1)) @@ -719,7 +719,7 @@ globalRegMaybe (DoubleReg 4) = Just (RealRegSingle REG_D4) # endif # endif -# ifdef REG_D5 +# if defined(REG_D5) globalRegMaybe (DoubleReg 5) = # if defined(MACHREGS_sparc) Just (RealRegPair REG_D5 (REG_D5 + 1)) @@ -727,7 +727,7 @@ globalRegMaybe (DoubleReg 5) = Just (RealRegSingle REG_D5) # endif # endif -# ifdef REG_D6 +# if defined(REG_D6) globalRegMaybe (DoubleReg 6) = # if defined(MACHREGS_sparc) Just (RealRegPair REG_D6 (REG_D6 + 1)) @@ -736,90 +736,90 @@ globalRegMaybe (DoubleReg 6) = # endif # endif # if MAX_REAL_XMM_REG != 0 -# ifdef REG_XMM1 +# if defined(REG_XMM1) globalRegMaybe (XmmReg 1) = Just (RealRegSingle REG_XMM1) # endif -# ifdef REG_XMM2 +# if defined(REG_XMM2) globalRegMaybe (XmmReg 2) = Just (RealRegSingle REG_XMM2) # endif -# ifdef REG_XMM3 +# if defined(REG_XMM3) globalRegMaybe (XmmReg 3) = Just (RealRegSingle REG_XMM3) # endif -# ifdef REG_XMM4 +# if defined(REG_XMM4) globalRegMaybe (XmmReg 4) = Just (RealRegSingle REG_XMM4) # endif -# ifdef REG_XMM5 +# if defined(REG_XMM5) globalRegMaybe (XmmReg 5) = Just (RealRegSingle REG_XMM5) # endif -# ifdef REG_XMM6 +# if defined(REG_XMM6) globalRegMaybe (XmmReg 6) = Just (RealRegSingle REG_XMM6) # endif # endif # if defined(MAX_REAL_YMM_REG) && MAX_REAL_YMM_REG != 0 -# ifdef REG_YMM1 +# if defined(REG_YMM1) globalRegMaybe (YmmReg 1) = Just (RealRegSingle REG_YMM1) # endif -# ifdef REG_YMM2 +# if defined(REG_YMM2) globalRegMaybe (YmmReg 2) = Just (RealRegSingle REG_YMM2) # endif -# ifdef REG_YMM3 +# if defined(REG_YMM3) globalRegMaybe (YmmReg 3) = Just (RealRegSingle REG_YMM3) # endif -# ifdef REG_YMM4 +# if defined(REG_YMM4) globalRegMaybe (YmmReg 4) = Just (RealRegSingle REG_YMM4) # endif -# ifdef REG_YMM5 +# if defined(REG_YMM5) globalRegMaybe (YmmReg 5) = Just (RealRegSingle REG_YMM5) # endif -# ifdef REG_YMM6 +# if defined(REG_YMM6) globalRegMaybe (YmmReg 6) = Just (RealRegSingle REG_YMM6) # endif # endif # if defined(MAX_REAL_ZMM_REG) && MAX_REAL_ZMM_REG != 0 -# ifdef REG_ZMM1 +# if defined(REG_ZMM1) globalRegMaybe (ZmmReg 1) = Just (RealRegSingle REG_ZMM1) # endif -# ifdef REG_ZMM2 +# if defined(REG_ZMM2) globalRegMaybe (ZmmReg 2) = Just (RealRegSingle REG_ZMM2) # endif -# ifdef REG_ZMM3 +# if defined(REG_ZMM3) globalRegMaybe (ZmmReg 3) = Just (RealRegSingle REG_ZMM3) # endif -# ifdef REG_ZMM4 +# if defined(REG_ZMM4) globalRegMaybe (ZmmReg 4) = Just (RealRegSingle REG_ZMM4) # endif -# ifdef REG_ZMM5 +# if defined(REG_ZMM5) globalRegMaybe (ZmmReg 5) = Just (RealRegSingle REG_ZMM5) # endif -# ifdef REG_ZMM6 +# if defined(REG_ZMM6) globalRegMaybe (ZmmReg 6) = Just (RealRegSingle REG_ZMM6) # endif # endif -# ifdef REG_Sp +# if defined(REG_Sp) globalRegMaybe Sp = Just (RealRegSingle REG_Sp) # endif -# ifdef REG_Lng1 +# if defined(REG_Lng1) globalRegMaybe (LongReg 1) = Just (RealRegSingle REG_Lng1) # endif -# ifdef REG_Lng2 +# if defined(REG_Lng2) globalRegMaybe (LongReg 2) = Just (RealRegSingle REG_Lng2) # endif -# ifdef REG_SpLim +# if defined(REG_SpLim) globalRegMaybe SpLim = Just (RealRegSingle REG_SpLim) # endif -# ifdef REG_Hp +# if defined(REG_Hp) globalRegMaybe Hp = Just (RealRegSingle REG_Hp) # endif -# ifdef REG_HpLim +# if defined(REG_HpLim) globalRegMaybe HpLim = Just (RealRegSingle REG_HpLim) # endif -# ifdef REG_CurrentTSO +# if defined(REG_CurrentTSO) globalRegMaybe CurrentTSO = Just (RealRegSingle REG_CurrentTSO) # endif -# ifdef REG_CurrentNursery +# if defined(REG_CurrentNursery) globalRegMaybe CurrentNursery = Just (RealRegSingle REG_CurrentNursery) # endif -# ifdef REG_MachSp +# if defined(REG_MachSp) globalRegMaybe MachSp = Just (RealRegSingle REG_MachSp) # endif globalRegMaybe _ = Nothing @@ -860,19 +860,19 @@ Hence, on x86 esi and edi are treated as not allocatable. freeReg r = freeRegBase r freeRegBase :: RegNo -> Bool -# ifdef REG_Base +# if defined(REG_Base) freeRegBase REG_Base = False # endif -# ifdef REG_Sp +# if defined(REG_Sp) freeRegBase REG_Sp = False # endif -# ifdef REG_SpLim +# if defined(REG_SpLim) freeRegBase REG_SpLim = False # endif -# ifdef REG_Hp +# if defined(REG_Hp) freeRegBase REG_Hp = False # endif -# ifdef REG_HpLim +# if defined(REG_HpLim) freeRegBase REG_HpLim = False # endif -- All other regs are considered to be "free", because we can track @@ -901,88 +901,88 @@ freeReg 30 = False -} # endif -# ifdef REG_Base +# if defined(REG_Base) freeReg REG_Base = False # endif -# ifdef REG_R1 +# if defined(REG_R1) freeReg REG_R1 = False # endif -# ifdef REG_R2 +# if defined(REG_R2) freeReg REG_R2 = False # endif -# ifdef REG_R3 +# if defined(REG_R3) freeReg REG_R3 = False # endif -# ifdef REG_R4 +# if defined(REG_R4) freeReg REG_R4 = False # endif -# ifdef REG_R5 +# if defined(REG_R5) freeReg REG_R5 = False # endif -# ifdef REG_R6 +# if defined(REG_R6) freeReg REG_R6 = False # endif -# ifdef REG_R7 +# if defined(REG_R7) freeReg REG_R7 = False # endif -# ifdef REG_R8 +# if defined(REG_R8) freeReg REG_R8 = False # endif -# ifdef REG_R9 +# if defined(REG_R9) freeReg REG_R9 = False # endif -# ifdef REG_R10 +# if defined(REG_R10) freeReg REG_R10 = False # endif -# ifdef REG_F1 +# if defined(REG_F1) freeReg REG_F1 = False # endif -# ifdef REG_F2 +# if defined(REG_F2) freeReg REG_F2 = False # endif -# ifdef REG_F3 +# if defined(REG_F3) freeReg REG_F3 = False # endif -# ifdef REG_F4 +# if defined(REG_F4) freeReg REG_F4 = False # endif -# ifdef REG_F5 +# if defined(REG_F5) freeReg REG_F5 = False # endif -# ifdef REG_F6 +# if defined(REG_F6) freeReg REG_F6 = False # endif -# ifdef REG_D1 +# if defined(REG_D1) freeReg REG_D1 = False # endif -# ifdef REG_D2 +# if defined(REG_D2) freeReg REG_D2 = False # endif -# ifdef REG_D3 +# if defined(REG_D3) freeReg REG_D3 = False # endif -# ifdef REG_D4 +# if defined(REG_D4) freeReg REG_D4 = False # endif -# ifdef REG_D5 +# if defined(REG_D5) freeReg REG_D5 = False # endif -# ifdef REG_D6 +# if defined(REG_D6) freeReg REG_D6 = False # endif -# ifdef REG_Sp +# if defined(REG_Sp) freeReg REG_Sp = False # endif -# ifdef REG_Su +# if defined(REG_Su) freeReg REG_Su = False # endif -# ifdef REG_SpLim +# if defined(REG_SpLim) freeReg REG_SpLim = False # endif -# ifdef REG_Hp +# if defined(REG_Hp) freeReg REG_Hp = False # endif -# ifdef REG_HpLim +# if defined(REG_HpLim) freeReg REG_HpLim = False # endif freeReg _ = True @@ -1029,106 +1029,106 @@ freeReg regNo = False -} -# ifdef REG_Base +# if defined(REG_Base) freeReg REG_Base = False # endif -# ifdef REG_R1 +# if defined(REG_R1) freeReg REG_R1 = False # endif -# ifdef REG_R2 +# if defined(REG_R2) freeReg REG_R2 = False # endif -# ifdef REG_R3 +# if defined(REG_R3) freeReg REG_R3 = False # endif -# ifdef REG_R4 +# if defined(REG_R4) freeReg REG_R4 = False # endif -# ifdef REG_R5 +# if defined(REG_R5) freeReg REG_R5 = False # endif -# ifdef REG_R6 +# if defined(REG_R6) freeReg REG_R6 = False # endif -# ifdef REG_R7 +# if defined(REG_R7) freeReg REG_R7 = False # endif -# ifdef REG_R8 +# if defined(REG_R8) freeReg REG_R8 = False # endif -# ifdef REG_R9 +# if defined(REG_R9) freeReg REG_R9 = False # endif -# ifdef REG_R10 +# if defined(REG_R10) freeReg REG_R10 = False # endif -# ifdef REG_F1 +# if defined(REG_F1) freeReg REG_F1 = False # endif -# ifdef REG_F2 +# if defined(REG_F2) freeReg REG_F2 = False # endif -# ifdef REG_F3 +# if defined(REG_F3) freeReg REG_F3 = False # endif -# ifdef REG_F4 +# if defined(REG_F4) freeReg REG_F4 = False # endif -# ifdef REG_F5 +# if defined(REG_F5) freeReg REG_F5 = False # endif -# ifdef REG_F6 +# if defined(REG_F6) freeReg REG_F6 = False # endif -# ifdef REG_D1 +# if defined(REG_D1) freeReg REG_D1 = False # endif -# ifdef REG_D1_2 +# if defined(REG_D1_2) freeReg REG_D1_2 = False # endif -# ifdef REG_D2 +# if defined(REG_D2) freeReg REG_D2 = False # endif -# ifdef REG_D2_2 +# if defined(REG_D2_2) freeReg REG_D2_2 = False # endif -# ifdef REG_D3 +# if defined(REG_D3) freeReg REG_D3 = False # endif -# ifdef REG_D3_2 +# if defined(REG_D3_2) freeReg REG_D3_2 = False # endif -# ifdef REG_D4 +# if defined(REG_D4) freeReg REG_D4 = False # endif -# ifdef REG_D4_2 +# if defined(REG_D4_2) freeReg REG_D4_2 = False # endif -# ifdef REG_D5 +# if defined(REG_D5) freeReg REG_D5 = False # endif -# ifdef REG_D5_2 +# if defined(REG_D5_2) freeReg REG_D5_2 = False # endif -# ifdef REG_D6 +# if defined(REG_D6) freeReg REG_D6 = False # endif -# ifdef REG_D6_2 +# if defined(REG_D6_2) freeReg REG_D6_2 = False # endif -# ifdef REG_Sp +# if defined(REG_Sp) freeReg REG_Sp = False # endif -# ifdef REG_Su +# if defined(REG_Su) freeReg REG_Su = False # endif -# ifdef REG_SpLim +# if defined(REG_SpLim) freeReg REG_SpLim = False # endif -# ifdef REG_Hp +# if defined(REG_Hp) freeReg REG_Hp = False # endif -# ifdef REG_HpLim +# if defined(REG_HpLim) freeReg REG_HpLim = False # endif freeReg _ = True diff --git a/includes/HsFFI.h b/includes/HsFFI.h index bee942c44c..dea365cb65 100644 --- a/includes/HsFFI.h +++ b/includes/HsFFI.h @@ -11,7 +11,7 @@ #pragma once -#ifdef __cplusplus +#if defined(__cplusplus) extern "C" { #endif @@ -118,6 +118,6 @@ extern void hs_try_putmvar (int capability, HsStablePtr sp); -#ifdef __cplusplus +#if defined(__cplusplus) } #endif diff --git a/includes/MachDeps.h b/includes/MachDeps.h index 778975ea3c..2be4ee0b4f 100644 --- a/includes/MachDeps.h +++ b/includes/MachDeps.h @@ -100,7 +100,7 @@ #define SIZEOF_WORD64 SIZEOF_UINT64_T #define ALIGNMENT_WORD64 ALIGNMENT_UINT64_T -#ifndef WORD_SIZE_IN_BITS +#if !defined(WORD_SIZE_IN_BITS) #if SIZEOF_HSWORD == 4 #define WORD_SIZE_IN_BITS 32 #define WORD_SIZE_IN_BITS_FLOAT 32.0 @@ -110,7 +110,7 @@ #endif #endif -#ifndef TAG_BITS +#if !defined(TAG_BITS) #if SIZEOF_HSWORD == 4 #define TAG_BITS 2 #else diff --git a/includes/Rts.h b/includes/Rts.h index b36fc94a5e..aca24e4f28 100644 --- a/includes/Rts.h +++ b/includes/Rts.h @@ -12,7 +12,7 @@ #pragma once -#ifdef __cplusplus +#if defined(__cplusplus) extern "C" { #endif @@ -23,7 +23,7 @@ extern "C" { #include <windows.h> #endif -#ifndef IN_STG_CODE +#if !defined(IN_STG_CODE) #define IN_STG_CODE 0 #endif #include "Stg.h" @@ -32,7 +32,7 @@ extern "C" { #include "RtsAPI.h" // Turn off inlining when debugging - it obfuscates things -#ifdef DEBUG +#if defined(DEBUG) # undef STATIC_INLINE # define STATIC_INLINE static #endif @@ -69,13 +69,13 @@ extern "C" { #endif /* Fix for mingw stat problem (done here so it's early enough) */ -#ifdef mingw32_HOST_OS +#if defined(mingw32_HOST_OS) #define __MSVCRT__ 1 #endif /* Needed to get the macro version of errno on some OSs, and also to get prototypes for the _r versions of C library functions. */ -#ifndef _REENTRANT +#if !defined(_REENTRANT) #define _REENTRANT 1 #endif @@ -109,7 +109,7 @@ void _assertFail(const char *filename, unsigned int linenum) else \ barf(msg, ##__VA_ARGS__) -#ifndef DEBUG +#if !defined(DEBUG) #define ASSERT(predicate) /* nothing */ #define ASSERTM(predicate,msg,...) /* nothing */ #else @@ -125,7 +125,7 @@ void _assertFail(const char *filename, unsigned int linenum) #define doNothing() do { } while (0) -#ifdef DEBUG +#if defined(DEBUG) #define USED_IF_DEBUG #define USED_IF_NOT_DEBUG STG_UNUSED #else @@ -133,7 +133,7 @@ void _assertFail(const char *filename, unsigned int linenum) #define USED_IF_NOT_DEBUG #endif -#ifdef THREADED_RTS +#if defined(THREADED_RTS) #define USED_IF_THREADS #define USED_IF_NOT_THREADS STG_UNUSED #else @@ -211,7 +211,7 @@ DLL_IMPORT_RTS extern char **prog_argv; /* so we can get at these from Haskell * DLL_IMPORT_RTS extern int prog_argc; DLL_IMPORT_RTS extern char *prog_name; -#ifdef mingw32_HOST_OS +#if defined(mingw32_HOST_OS) // We need these two from Haskell too void getWin32ProgArgv(int *argc, wchar_t **argv[]); void setWin32ProgArgv(int argc, wchar_t *argv[]); @@ -222,7 +222,7 @@ void reportHeapOverflow(void); void stg_exit(int n) GNU_ATTRIBUTE(__noreturn__); -#ifndef mingw32_HOST_OS +#if !defined(mingw32_HOST_OS) int stg_sig_install (int, int, void *); #endif @@ -251,7 +251,7 @@ int rts_isDynamic(void); Miscellaneous garbage -------------------------------------------------------------------------- */ -#ifdef DEBUG +#if defined(DEBUG) #define TICK_VAR(arity) \ extern StgInt SLOW_CALLS_##arity; \ extern StgInt RIGHT_ARITY_##arity; \ @@ -269,7 +269,7 @@ TICK_VAR(2) #define IF_RTSFLAGS(c,s) if (RtsFlags.c) { s; } doNothing() -#ifdef DEBUG +#if defined(DEBUG) #if IN_STG_CODE #define IF_DEBUG(c,s) if (RtsFlags[0].DebugFlags.c) { s; } doNothing() #else @@ -279,13 +279,13 @@ TICK_VAR(2) #define IF_DEBUG(c,s) doNothing() #endif -#ifdef DEBUG +#if defined(DEBUG) #define DEBUG_ONLY(s) s #else #define DEBUG_ONLY(s) doNothing() #endif -#ifdef DEBUG +#if defined(DEBUG) #define DEBUG_IS_ON 1 #else #define DEBUG_IS_ON 0 @@ -309,6 +309,6 @@ TICK_VAR(2) /* -------------------------------------------------------------------------- */ -#ifdef __cplusplus +#if defined(__cplusplus) } #endif diff --git a/includes/RtsAPI.h b/includes/RtsAPI.h index f9b561800d..f1c04fa360 100644 --- a/includes/RtsAPI.h +++ b/includes/RtsAPI.h @@ -11,7 +11,7 @@ #pragma once -#ifdef __cplusplus +#if defined(__cplusplus) extern "C" { #endif @@ -236,7 +236,7 @@ extern void hs_init_ghc (int *argc, char **argv[], // program arguments extern void shutdownHaskellAndExit (int exitCode, int fastExit) GNUC3_ATTRIBUTE(__noreturn__); -#ifndef mingw32_HOST_OS +#if !defined(mingw32_HOST_OS) extern void shutdownHaskellAndSignal (int sig, int fastExit) GNUC3_ATTRIBUTE(__noreturn__); #endif @@ -441,6 +441,6 @@ extern StgWord base_GHCziTopHandler_runNonIO_closure[]; /* ------------------------------------------------------------------------ */ -#ifdef __cplusplus +#if defined(__cplusplus) } #endif diff --git a/includes/Stg.h b/includes/Stg.h index a0886ef727..df71e4e7df 100644 --- a/includes/Stg.h +++ b/includes/Stg.h @@ -40,7 +40,7 @@ * IN_STG_CODE is not defined, and the register variables will not be * active. */ -#ifndef IN_STG_CODE +#if !defined(IN_STG_CODE) # define IN_STG_CODE 1 // Turn on C99 for .hc code. This gives us the INFINITY and NAN @@ -154,7 +154,7 @@ # define FORCE_GNU_INLINE 1 #endif -#ifdef FORCE_GNU_INLINE +#if defined(FORCE_GNU_INLINE) // Force compiler into gnu90 semantics # if defined(KEEP_INLINES) # define EXTERN_INLINE inline __attribute__((gnu_inline)) @@ -524,7 +524,7 @@ INLINE_HEADER StgInt64 PK_Int64(W_ p_src[]) #if SIZEOF_VOID_P == 4 -#ifdef WORDS_BIGENDIAN +#if defined(WORDS_BIGENDIAN) #define RTS_CARRY_IDX__ 0 #define RTS_REM_IDX__ 1 #else diff --git a/includes/rts/EventLogFormat.h b/includes/rts/EventLogFormat.h index 160aa19303..b63f842008 100644 --- a/includes/rts/EventLogFormat.h +++ b/includes/rts/EventLogFormat.h @@ -230,7 +230,7 @@ #define CAPSET_TYPE_OSPROCESS 2 /* caps belong to the same OS process */ #define CAPSET_TYPE_CLOCKDOMAIN 3 /* caps share a local clock/time */ -#ifndef EVENTLOG_CONSTANTS_ONLY +#if !defined(EVENTLOG_CONSTANTS_ONLY) typedef StgWord16 EventTypeNum; typedef StgWord64 EventTimestamp; /* in nanoseconds */ diff --git a/includes/rts/Flags.h b/includes/rts/Flags.h index 405fce166d..6700f9d95f 100644 --- a/includes/rts/Flags.h +++ b/includes/rts/Flags.h @@ -245,7 +245,7 @@ typedef struct _RTS_FLAGS { PAR_FLAGS ParFlags; } RTS_FLAGS; -#ifdef COMPILING_RTS_MAIN +#if defined(COMPILING_RTS_MAIN) extern DLLIMPORT RTS_FLAGS RtsFlags; #elif IN_STG_CODE /* Hack because the C code generator can't generate '&label'. */ diff --git a/includes/rts/OSThreads.h b/includes/rts/OSThreads.h index 520d592ec6..abb3120088 100644 --- a/includes/rts/OSThreads.h +++ b/includes/rts/OSThreads.h @@ -16,7 +16,7 @@ #if defined(HAVE_PTHREAD_H) && !defined(mingw32_HOST_OS) -#ifdef CMINUSMINUS +#if defined(CMINUSMINUS) #define OS_ACQUIRE_LOCK(mutex) foreign "C" pthread_mutex_lock(mutex) #define OS_RELEASE_LOCK(mutex) foreign "C" pthread_mutex_unlock(mutex) @@ -36,7 +36,7 @@ typedef pthread_key_t ThreadLocalKey; #define INIT_COND_VAR PTHREAD_COND_INITIALIZER -#ifdef LOCK_DEBUG +#if defined(LOCK_DEBUG) #define LOCK_DEBUG_BELCH(what, mutex) \ debugBelch("%s(0x%p) %s %d\n", what, mutex, __FILE__, __LINE__) #else @@ -75,7 +75,7 @@ EXTERN_INLINE int TRY_ACQUIRE_LOCK(pthread_mutex_t *mutex) # elif defined(HAVE_WINDOWS_H) -#ifdef CMINUSMINUS +#if defined(CMINUSMINUS) /* We jump through a hoop here to get a CCall EnterCriticalSection and LeaveCriticalSection, as that's what C-- wants. */ @@ -110,7 +110,7 @@ typedef DWORD ThreadLocalKey; typedef CRITICAL_SECTION Mutex; -#ifdef LOCK_DEBUG +#if defined(LOCK_DEBUG) #define OS_ACQUIRE_LOCK(mutex) \ debugBelch("ACQUIRE_LOCK(0x%p) %s %d\n", mutex,__FILE__,__LINE__); \ @@ -158,7 +158,7 @@ typedef HANDLE Mutex; # endif -#ifndef CMINUSMINUS +#if !defined(CMINUSMINUS) // // General thread operations // @@ -202,7 +202,7 @@ void setThreadNode (uint32_t node); void releaseThreadNode (void); #endif // !CMINUSMINUS -#ifdef THREADED_RTS +#if defined(THREADED_RTS) #define ACQUIRE_LOCK(l) OS_ACQUIRE_LOCK(l) #define RELEASE_LOCK(l) OS_RELEASE_LOCK(l) @@ -216,7 +216,7 @@ void releaseThreadNode (void); #endif /* defined(THREADED_RTS) */ -#ifndef CMINUSMINUS +#if !defined(CMINUSMINUS) // // Support for forkOS (defined regardless of THREADED_RTS, but does // nothing when !THREADED_RTS). diff --git a/includes/rts/Threads.h b/includes/rts/Threads.h index 17a64c1ba0..fceacdc75d 100644 --- a/includes/rts/Threads.h +++ b/includes/rts/Threads.h @@ -14,7 +14,7 @@ #pragma once -#ifdef HAVE_SYS_TYPES_H +#if defined(HAVE_SYS_TYPES_H) #include <sys/types.h> #endif diff --git a/includes/rts/prof/LDV.h b/includes/rts/prof/LDV.h index fdbab4d901..dc7a0cabdf 100644 --- a/includes/rts/prof/LDV.h +++ b/includes/rts/prof/LDV.h @@ -13,7 +13,7 @@ #pragma once -#ifdef PROFILING +#if defined(PROFILING) /* retrieves the LDV word from closure c */ #define LDVW(c) (((StgClosure *)(c))->header.prof.hp.ldvw) @@ -28,7 +28,7 @@ * to zero. */ -#ifdef CMINUSMINUS +#if defined(CMINUSMINUS) #else diff --git a/includes/rts/storage/Block.h b/includes/rts/storage/Block.h index 3c6f2b1fba..c1d251856a 100644 --- a/includes/rts/storage/Block.h +++ b/includes/rts/storage/Block.h @@ -24,7 +24,7 @@ #error "Size of pointer is suspicious." #endif -#ifdef CMINUSMINUS +#if defined(CMINUSMINUS) #define BLOCK_SIZE (1<<BLOCK_SHIFT) #else #define BLOCK_SIZE (UNIT<<BLOCK_SHIFT) @@ -39,7 +39,7 @@ /* Megablock related constants (MBLOCK_SHIFT is defined in Constants.h) */ -#ifdef CMINUSMINUS +#if defined(CMINUSMINUS) #define MBLOCK_SIZE (1<<MBLOCK_SHIFT) #else #define MBLOCK_SIZE (UNIT<<MBLOCK_SHIFT) @@ -83,7 +83,7 @@ // client of the block allocator API. All other fields can be // freely modified. -#ifndef CMINUSMINUS +#if !defined(CMINUSMINUS) typedef struct bdescr_ { StgPtr start; // [READ ONLY] start addr of memory @@ -160,7 +160,7 @@ typedef struct bdescr_ { /* Finding the block descriptor for a given block -------------------------- */ -#ifdef CMINUSMINUS +#if defined(CMINUSMINUS) #define Bdescr(p) \ ((((p) & MBLOCK_MASK & ~BLOCK_MASK) >> (BLOCK_SHIFT-BDESCR_SHIFT)) \ @@ -206,7 +206,7 @@ EXTERN_INLINE bdescr *Bdescr(StgPtr p) /* Number of usable blocks in a megablock */ -#ifndef CMINUSMINUS // already defined in DerivedConstants.h +#if !defined(CMINUSMINUS) // already defined in DerivedConstants.h #define BLOCKS_PER_MBLOCK ((MBLOCK_SIZE - FIRST_BLOCK_OFF) / BLOCK_SIZE) #endif @@ -221,7 +221,7 @@ EXTERN_INLINE bdescr *Bdescr(StgPtr p) (1 + (W_)MBLOCK_ROUND_UP((n-BLOCKS_PER_MBLOCK) * BLOCK_SIZE) / MBLOCK_SIZE) -#ifndef CMINUSMINUS +#if !defined(CMINUSMINUS) /* to the end... */ /* Double-linked block lists: --------------------------------------------- */ diff --git a/includes/rts/storage/ClosureMacros.h b/includes/rts/storage/ClosureMacros.h index af77df37b5..be1569ba8e 100644 --- a/includes/rts/storage/ClosureMacros.h +++ b/includes/rts/storage/ClosureMacros.h @@ -54,7 +54,7 @@ INLINE_HEADER const StgInfoTable *GET_INFO(StgClosure *c) { #define GET_ENTRY(c) (ENTRY_CODE(GET_INFO(c))) -#ifdef TABLES_NEXT_TO_CODE +#if defined(TABLES_NEXT_TO_CODE) EXTERN_INLINE StgInfoTable *INFO_PTR_TO_STRUCT(const StgInfoTable *info); EXTERN_INLINE StgInfoTable *INFO_PTR_TO_STRUCT(const StgInfoTable *info) {return (StgInfoTable *)info - 1;} EXTERN_INLINE StgRetInfoTable *RET_INFO_PTR_TO_STRUCT(const StgInfoTable *info); @@ -116,8 +116,8 @@ INLINE_HEADER StgHalfWord GET_TAG(const StgClosure *con) Macros for building closures -------------------------------------------------------------------------- */ -#ifdef PROFILING -#ifdef DEBUG_RETAINER +#if defined(PROFILING) +#if defined(DEBUG_RETAINER) /* For the sake of debugging, we take the safest way for the moment. Actually, this is useful to check the sanity of heap before beginning retainer profiling. @@ -540,7 +540,7 @@ INLINE_HEADER StgWord8 *mutArrPtrsCard (StgMutArrPtrs *a, W_ n) #define OVERWRITING_CLOSURE_OFS(c,n) /* nothing */ #endif -#ifdef PROFILING +#if defined(PROFILING) void LDV_recordDead (const StgClosure *c, uint32_t size); #endif diff --git a/includes/rts/storage/Closures.h b/includes/rts/storage/Closures.h index f5baead002..af89507f97 100644 --- a/includes/rts/storage/Closures.h +++ b/includes/rts/storage/Closures.h @@ -51,14 +51,14 @@ typedef struct { typedef struct { const StgInfoTable* info; -#ifdef PROFILING +#if defined(PROFILING) StgProfHeader prof; #endif } StgHeader; typedef struct { const StgInfoTable* info; -#ifdef PROFILING +#if defined(PROFILING) StgProfHeader prof; #endif StgSMPThunkHeader smp; diff --git a/includes/rts/storage/InfoTables.h b/includes/rts/storage/InfoTables.h index 3201c105e1..c621e5e749 100644 --- a/includes/rts/storage/InfoTables.h +++ b/includes/rts/storage/InfoTables.h @@ -27,7 +27,7 @@ hackery can go away sometime. ------------------------------------------------------------------------- */ -#ifdef x86_64_TARGET_ARCH +#if defined(x86_64_TARGET_ARCH) #define OFFSET_FIELD(n) StgHalfInt n; StgHalfWord __pad_##n #else #define OFFSET_FIELD(n) StgInt n @@ -38,7 +38,7 @@ -------------------------------------------------------------------------- */ typedef struct { -#ifndef TABLES_NEXT_TO_CODE +#if !defined(TABLES_NEXT_TO_CODE) char *closure_type; char *closure_desc; #else @@ -167,7 +167,7 @@ typedef union { StgWord bitmap; /* word-sized bit pattern describing */ /* a stack frame: see below */ -#ifndef TABLES_NEXT_TO_CODE +#if !defined(TABLES_NEXT_TO_CODE) StgLargeBitmap* large_bitmap; /* pointer to large bitmap structure */ #else OFFSET_FIELD(large_bitmap_offset); /* offset from info table to large bitmap structure */ @@ -187,7 +187,7 @@ typedef struct StgInfoTable_ { StgFunPtr entry; /* pointer to the entry code */ #endif -#ifdef PROFILING +#if defined(PROFILING) StgProfInfo prof; #endif @@ -201,7 +201,7 @@ typedef struct StgInfoTable_ { - a bitmap of SRT entries */ -#ifdef TABLES_NEXT_TO_CODE +#if defined(TABLES_NEXT_TO_CODE) StgCode code[]; #endif } *StgInfoTablePtr; // StgInfoTable defined in rts/Types.h @@ -339,7 +339,7 @@ typedef struct StgConInfoTable_ { * GET_SRT(info) * info must be a Stg[Ret|Thunk]InfoTable* (an info table that has a SRT) */ -#ifdef TABLES_NEXT_TO_CODE +#if defined(TABLES_NEXT_TO_CODE) #define GET_SRT(info) ((StgSRT*) (((StgWord) ((info)+1)) + (info)->srt_offset)) #else #define GET_SRT(info) ((info)->srt) @@ -349,7 +349,7 @@ typedef struct StgConInfoTable_ { * GET_CON_DESC(info) * info must be a StgConInfoTable*. */ -#ifdef TABLES_NEXT_TO_CODE +#if defined(TABLES_NEXT_TO_CODE) #define GET_CON_DESC(info) \ ((const char *)((StgWord)((info)+1) + (info->con_desc))) #else @@ -360,20 +360,20 @@ typedef struct StgConInfoTable_ { * GET_FUN_SRT(info) * info must be a StgFunInfoTable* */ -#ifdef TABLES_NEXT_TO_CODE +#if defined(TABLES_NEXT_TO_CODE) #define GET_FUN_SRT(info) ((StgSRT*) (((StgWord) ((info)+1)) + (info)->f.srt_offset)) #else #define GET_FUN_SRT(info) ((info)->f.srt) #endif -#ifdef TABLES_NEXT_TO_CODE +#if defined(TABLES_NEXT_TO_CODE) #define GET_LARGE_BITMAP(info) ((StgLargeBitmap*) (((StgWord) ((info)+1)) \ + (info)->layout.large_bitmap_offset)) #else #define GET_LARGE_BITMAP(info) ((info)->layout.large_bitmap) #endif -#ifdef TABLES_NEXT_TO_CODE +#if defined(TABLES_NEXT_TO_CODE) #define GET_FUN_LARGE_BITMAP(info) ((StgLargeBitmap*) (((StgWord) ((info)+1)) \ + (info)->f.b.bitmap_offset)) #else @@ -383,12 +383,12 @@ typedef struct StgConInfoTable_ { /* * GET_PROF_TYPE, GET_PROF_DESC */ -#ifdef TABLES_NEXT_TO_CODE +#if defined(TABLES_NEXT_TO_CODE) #define GET_PROF_TYPE(info) ((char *)((StgWord)((info)+1) + (info->prof.closure_type_off))) #else #define GET_PROF_TYPE(info) ((info)->prof.closure_type) #endif -#ifdef TABLES_NEXT_TO_CODE +#if defined(TABLES_NEXT_TO_CODE) #define GET_PROF_DESC(info) ((char *)((StgWord)((info)+1) + (info->prof.closure_desc_off))) #else #define GET_PROF_DESC(info) ((info)->prof.closure_desc) diff --git a/includes/rts/storage/MBlock.h b/includes/rts/storage/MBlock.h index 9fbe92ec7d..20aed08e82 100644 --- a/includes/rts/storage/MBlock.h +++ b/includes/rts/storage/MBlock.h @@ -26,7 +26,7 @@ extern void freeAllMBlocks(void); extern void *getFirstMBlock(void **state); extern void *getNextMBlock(void **state, void *mblock); -#ifdef THREADED_RTS +#if defined(THREADED_RTS) // needed for HEAP_ALLOCED below extern SpinLock gc_alloc_block_sync; #endif diff --git a/includes/rts/storage/TSO.h b/includes/rts/storage/TSO.h index e50e336a32..93018581fd 100644 --- a/includes/rts/storage/TSO.h +++ b/includes/rts/storage/TSO.h @@ -173,13 +173,13 @@ typedef struct StgTSO_ { */ StgWord32 tot_stack_size; -#ifdef TICKY_TICKY +#if defined(TICKY_TICKY) /* TICKY-specific stuff would go here. */ #endif -#ifdef PROFILING +#if defined(PROFILING) StgTSOProfInfo prof; #endif -#ifdef mingw32_HOST_OS +#if defined(mingw32_HOST_OS) StgWord32 saved_winerror; #endif diff --git a/includes/stg/DLL.h b/includes/stg/DLL.h index cf857a8682..7ab3594ce1 100644 --- a/includes/stg/DLL.h +++ b/includes/stg/DLL.h @@ -46,7 +46,7 @@ sources are being processed. This is only the case when using Win32 DLLs. ] */ -#ifdef COMPILING_RTS +#if defined(COMPILING_RTS) #define DLL_IMPORT DLLIMPORT #define DLL_IMPORT_RTS #define DLL_IMPORT_DATA_VAR(x) x @@ -65,7 +65,7 @@ #endif -#ifdef COMPILING_STDLIB +#if defined(COMPILING_STDLIB) #define DLL_IMPORT_STDLIB #else #define DLL_IMPORT_STDLIB DLLIMPORT diff --git a/includes/stg/HaskellMachRegs.h b/includes/stg/HaskellMachRegs.h index 89a2b95399..c92f6867c1 100644 --- a/includes/stg/HaskellMachRegs.h +++ b/includes/stg/HaskellMachRegs.h @@ -24,7 +24,7 @@ * the stack, and components of an unboxed tuple will be returned on * the stack rather than in registers. */ -#ifdef NO_REGS +#if defined(NO_REGS) #define MACHREGS_NO_REGS 1 @@ -32,11 +32,11 @@ #define MACHREGS_NO_REGS 0 -#ifdef i386_TARGET_ARCH +#if defined(i386_TARGET_ARCH) #define MACHREGS_i386 1 #endif -#ifdef x86_64_TARGET_ARCH +#if defined(x86_64_TARGET_ARCH) #define MACHREGS_x86_64 1 #endif @@ -45,19 +45,19 @@ #define MACHREGS_powerpc 1 #endif -#ifdef sparc_TARGET_ARCH +#if defined(sparc_TARGET_ARCH) #define MACHREGS_sparc 1 #endif -#ifdef arm_TARGET_ARCH +#if defined(arm_TARGET_ARCH) #define MACHREGS_arm 1 #endif -#ifdef aarch64_TARGET_ARCH +#if defined(aarch64_TARGET_ARCH) #define MACHREGS_aarch64 1 #endif -#ifdef darwin_TARGET_OS +#if defined(darwin_TARGET_OS) #define MACHREGS_darwin 1 #endif diff --git a/includes/stg/MachRegs.h b/includes/stg/MachRegs.h index f58e49e626..eab4a306ed 100644 --- a/includes/stg/MachRegs.h +++ b/includes/stg/MachRegs.h @@ -81,16 +81,16 @@ Leaving SpLim out of the picture. -------------------------------------------------------------------------- */ -#ifdef MACHREGS_i386 +#if defined(MACHREGS_i386) #define REG(x) __asm__("%" #x) -#ifndef not_doing_dynamic_linking +#if !defined(not_doing_dynamic_linking) #define REG_Base ebx #endif #define REG_Sp ebp -#ifndef STOLEN_X86_REGS +#if !defined(STOLEN_X86_REGS) #define STOLEN_X86_REGS 4 #endif @@ -315,7 +315,7 @@ the stack. See Note [Overlapping global registers] for implications. #define REG_R7 r20 #define REG_R8 r21 -#ifdef MACHREGS_darwin +#if defined(MACHREGS_darwin) #define REG_F1 f14 #define REG_F2 f15 @@ -629,7 +629,7 @@ the stack. See Note [Overlapping global registers] for implications. * communicate with PrimOps and RTS functions. */ -#ifndef MAX_REAL_VANILLA_REG +#if !defined(MAX_REAL_VANILLA_REG) # if defined(REG_R10) # define MAX_REAL_VANILLA_REG 10 # elif defined(REG_R9) @@ -655,7 +655,7 @@ the stack. See Note [Overlapping global registers] for implications. # endif #endif -#ifndef MAX_REAL_FLOAT_REG +#if !defined(MAX_REAL_FLOAT_REG) # if defined(REG_F4) # define MAX_REAL_FLOAT_REG 4 # elif defined(REG_F3) @@ -669,7 +669,7 @@ the stack. See Note [Overlapping global registers] for implications. # endif #endif -#ifndef MAX_REAL_DOUBLE_REG +#if !defined(MAX_REAL_DOUBLE_REG) # if defined(REG_D2) # define MAX_REAL_DOUBLE_REG 2 # elif defined(REG_D1) @@ -679,7 +679,7 @@ the stack. See Note [Overlapping global registers] for implications. # endif #endif -#ifndef MAX_REAL_LONG_REG +#if !defined(MAX_REAL_LONG_REG) # if defined(REG_L1) # define MAX_REAL_LONG_REG 1 # else @@ -687,7 +687,7 @@ the stack. See Note [Overlapping global registers] for implications. # endif #endif -#ifndef MAX_REAL_XMM_REG +#if !defined(MAX_REAL_XMM_REG) # if defined(REG_XMM6) # define MAX_REAL_XMM_REG 6 # elif defined(REG_XMM5) diff --git a/includes/stg/MiscClosures.h b/includes/stg/MiscClosures.h index 725323b395..4e8fe68bd6 100644 --- a/includes/stg/MiscClosures.h +++ b/includes/stg/MiscClosures.h @@ -35,7 +35,7 @@ # define RTS_FUN_DECL(f) extern DLL_IMPORT_RTS StgFunPtr f(void) #endif -#ifdef TABLES_NEXT_TO_CODE +#if defined(TABLES_NEXT_TO_CODE) # define RTS_RET(f) RTS_INFO(f##_info) # define RTS_ENTRY(f) RTS_INFO(f##_info) # define RTS_FUN(f) RTS_FUN_INFO(f##_info) @@ -318,7 +318,7 @@ RTS_RET(stg_block_takemvar); RTS_RET(stg_block_readmvar); RTS_FUN_DECL(stg_block_putmvar); RTS_RET(stg_block_putmvar); -#ifdef mingw32_HOST_OS +#if defined(mingw32_HOST_OS) RTS_FUN_DECL(stg_block_async); RTS_RET(stg_block_async); RTS_FUN_DECL(stg_block_async_void); @@ -395,7 +395,7 @@ RTS_FUN_DECL(stg_tryReadMVarzh); RTS_FUN_DECL(stg_waitReadzh); RTS_FUN_DECL(stg_waitWritezh); RTS_FUN_DECL(stg_delayzh); -#ifdef mingw32_HOST_OS +#if defined(mingw32_HOST_OS) RTS_FUN_DECL(stg_asyncReadzh); RTS_FUN_DECL(stg_asyncWritezh); RTS_FUN_DECL(stg_asyncDoProczh); diff --git a/includes/stg/RtsMachRegs.h b/includes/stg/RtsMachRegs.h index 627bdfeebb..e1233a1a55 100644 --- a/includes/stg/RtsMachRegs.h +++ b/includes/stg/RtsMachRegs.h @@ -14,8 +14,8 @@ #pragma once -#ifdef UnregisterisedCompiler -#ifndef NO_REGS +#if defined(UnregisterisedCompiler) +#if !defined(NO_REGS) #define NO_REGS #endif #endif @@ -30,7 +30,7 @@ * the stack, and components of an unboxed tuple will be returned on * the stack rather than in registers. */ -#ifdef NO_REGS +#if defined(NO_REGS) #define MACHREGS_NO_REGS 1 @@ -38,11 +38,11 @@ #define MACHREGS_NO_REGS 0 -#ifdef i386_HOST_ARCH +#if defined(i386_HOST_ARCH) #define MACHREGS_i386 1 #endif -#ifdef x86_64_HOST_ARCH +#if defined(x86_64_HOST_ARCH) #define MACHREGS_x86_64 1 #endif @@ -51,19 +51,19 @@ #define MACHREGS_powerpc 1 #endif -#ifdef sparc_HOST_ARCH +#if defined(sparc_HOST_ARCH) #define MACHREGS_sparc 1 #endif -#ifdef arm_HOST_ARCH +#if defined(arm_HOST_ARCH) #define MACHREGS_arm 1 #endif -#ifdef aarch64_HOST_ARCH +#if defined(aarch64_HOST_ARCH) #define MACHREGS_aarch64 1 #endif -#ifdef darwin_HOST_OS +#if defined(darwin_HOST_OS) #define MACHREGS_darwin 1 #endif diff --git a/includes/stg/Ticky.h b/includes/stg/Ticky.h index 1e16a1ae08..5e2c372610 100644 --- a/includes/stg/Ticky.h +++ b/includes/stg/Ticky.h @@ -35,7 +35,7 @@ extern W_ top_ct[]; same declarations for both extern decls (which are included everywhere) and initializations (which only happen once) TICKY_C is defined only in rts/Ticky.c */ -#ifdef TICKY_C +#if defined(TICKY_C) #define INIT(ializer) = ializer #define EXTERN #else @@ -197,8 +197,8 @@ EXTERN StgInt RET_UNBOXED_TUP_hst[TICKY_BIN_COUNT] INIT({0}); Note that these macros must be defined whether TICKY_TICKY is defined or not. */ - -#ifndef CMINUSMINUS + +#if !defined(CMINUSMINUS) #define TICK_BUMP_BY(ctr,n) ctr = (StgInt) ctr + n #define TICK_BUMP(ctr) TICK_BUMP_BY(ctr,1) |