summaryrefslogtreecommitdiff
path: root/rts/sm
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2017-04-22 09:34:18 -0400
committerBen Gamari <ben@smart-cactus.org>2017-04-23 11:05:48 -0400
commitf13eebcc9b1407e5aeaf010536fcb5e469dbfe71 (patch)
tree99bb45d293b74ba0570a2555e07fed09f8c3f659 /rts/sm
parent87fbf39a61d2535a172fbcecec098730eba1777f (diff)
downloadhaskell-f13eebcc9b1407e5aeaf010536fcb5e469dbfe71.tar.gz
cpp: Use #pragma once instead of #ifndef guards
This both says what we mean and silences a bunch of spurious CPP linting warnings. This pragma is supported by all CPP implementations which we support. Reviewers: austin, erikd, simonmar, hvr Reviewed By: simonmar Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3482
Diffstat (limited to 'rts/sm')
-rw-r--r--rts/sm/BlockAlloc.h5
-rw-r--r--rts/sm/CNF.h5
-rw-r--r--rts/sm/Compact.h5
-rw-r--r--rts/sm/Evac.h6
-rw-r--r--rts/sm/GC.h5
-rw-r--r--rts/sm/GCTDecl.h5
-rw-r--r--rts/sm/GCThread.h5
-rw-r--r--rts/sm/GCUtils.h5
-rw-r--r--rts/sm/HeapAlloc.h5
-rw-r--r--rts/sm/MarkStack.h5
-rw-r--r--rts/sm/MarkWeak.h5
-rw-r--r--rts/sm/OSMem.h5
-rw-r--r--rts/sm/Sanity.h5
-rw-r--r--rts/sm/Scav.h6
-rw-r--r--rts/sm/ShouldCompact.h5
-rw-r--r--rts/sm/Storage.h5
-rw-r--r--rts/sm/Sweep.h5
17 files changed, 17 insertions, 70 deletions
diff --git a/rts/sm/BlockAlloc.h b/rts/sm/BlockAlloc.h
index c26ae104e1..9b561df5db 100644
--- a/rts/sm/BlockAlloc.h
+++ b/rts/sm/BlockAlloc.h
@@ -6,8 +6,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef BLOCK_ALLOC_H
-#define BLOCK_ALLOC_H
+#pragma once
#include "BeginPrivate.h"
@@ -31,5 +30,3 @@ extern W_ n_alloc_blocks; // currently allocated blocks
extern W_ hw_alloc_blocks; // high-water allocated blocks
#include "EndPrivate.h"
-
-#endif /* BLOCK_ALLOC_H */
diff --git a/rts/sm/CNF.h b/rts/sm/CNF.h
index d888b0ce31..a01c153213 100644
--- a/rts/sm/CNF.h
+++ b/rts/sm/CNF.h
@@ -11,8 +11,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef SM_CNF_H
-#define SM_CNF_H
+#pragma once
#include "BeginPrivate.h"
@@ -81,5 +80,3 @@ extern void insertCompactHash (Capability *cap,
extern void verifyCompact (StgCompactNFData *str);
#include "EndPrivate.h"
-
-#endif // SM_COMPACT_H
diff --git a/rts/sm/Compact.h b/rts/sm/Compact.h
index 7ff6e12d14..6dcb50b1aa 100644
--- a/rts/sm/Compact.h
+++ b/rts/sm/Compact.h
@@ -11,8 +11,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef SM_COMPACT_H
-#define SM_COMPACT_H
+#pragma once
#include "BeginPrivate.h"
@@ -49,5 +48,3 @@ is_marked(StgPtr p, bdescr *bd)
void compact (StgClosure *static_objects);
#include "EndPrivate.h"
-
-#endif /* SM_COMPACT_H */
diff --git a/rts/sm/Evac.h b/rts/sm/Evac.h
index 62d54eb7b9..65a15a2493 100644
--- a/rts/sm/Evac.h
+++ b/rts/sm/Evac.h
@@ -11,8 +11,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef SM_EVAC_H
-#define SM_EVAC_H
+#pragma once
#include "BeginPrivate.h"
@@ -38,6 +37,3 @@ REGPARM1 void evacuate1 (StgClosure **p);
extern W_ thunk_selector_depth;
#include "EndPrivate.h"
-
-#endif /* SM_EVAC_H */
-
diff --git a/rts/sm/GC.h b/rts/sm/GC.h
index a2bf6123d6..a176fde3f6 100644
--- a/rts/sm/GC.h
+++ b/rts/sm/GC.h
@@ -11,8 +11,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef SM_GC_H
-#define SM_GC_H
+#pragma once
#include "BeginPrivate.h"
@@ -62,5 +61,3 @@ void releaseGCThreads (Capability *cap, bool idle_cap[]);
#define WORK_UNIT_WORDS 128
#include "EndPrivate.h"
-
-#endif /* SM_GC_H */
diff --git a/rts/sm/GCTDecl.h b/rts/sm/GCTDecl.h
index f1f9516098..d3717d1e45 100644
--- a/rts/sm/GCTDecl.h
+++ b/rts/sm/GCTDecl.h
@@ -9,8 +9,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef SM_GCTDECL_H
-#define SM_GCTDECL_H
+#pragma once
#include "BeginPrivate.h"
@@ -143,5 +142,3 @@ extern __thread gc_thread* gct;
#endif // THREADED_RTS
#include "EndPrivate.h"
-
-#endif // SM_GCTDECL_H
diff --git a/rts/sm/GCThread.h b/rts/sm/GCThread.h
index 89457e6467..15f1f13f20 100644
--- a/rts/sm/GCThread.h
+++ b/rts/sm/GCThread.h
@@ -11,8 +11,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef SM_GCTHREAD_H
-#define SM_GCTHREAD_H
+#pragma once
#include "WSDeque.h"
#include "GetTime.h" // for Ticks
@@ -208,5 +207,3 @@ extern ThreadLocalKey gctKey;
#endif
#include "EndPrivate.h"
-
-#endif // SM_GCTHREAD_H
diff --git a/rts/sm/GCUtils.h b/rts/sm/GCUtils.h
index 3092262af6..072b1fc60d 100644
--- a/rts/sm/GCUtils.h
+++ b/rts/sm/GCUtils.h
@@ -11,8 +11,7 @@
*
* --------------------------------------------------------------------------*/
-#ifndef SM_GCUTILS_H
-#define SM_GCUTILS_H
+#pragma once
#include "BeginPrivate.h"
@@ -76,5 +75,3 @@ recordMutableGen_GC (StgClosure *p, uint32_t gen_no)
}
#include "EndPrivate.h"
-
-#endif /* SM_GCUTILS_H */
diff --git a/rts/sm/HeapAlloc.h b/rts/sm/HeapAlloc.h
index 0ec1e6d7bb..a74e79a86d 100644
--- a/rts/sm/HeapAlloc.h
+++ b/rts/sm/HeapAlloc.h
@@ -6,8 +6,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef SM_HEAP_ALLOC_H
-#define SM_HEAP_ALLOC_H
+#pragma once
#include "BeginPrivate.h"
@@ -223,5 +222,3 @@ StgBool HEAP_ALLOCED_GC(void *p)
#endif
#include "EndPrivate.h"
-
-#endif /* SM_HEAP_ALLOC_H */
diff --git a/rts/sm/MarkStack.h b/rts/sm/MarkStack.h
index 881e2b0b17..51eee5770d 100644
--- a/rts/sm/MarkStack.h
+++ b/rts/sm/MarkStack.h
@@ -11,8 +11,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef SM_MARKSTACK_H
-#define SM_MARKSTACK_H
+#pragma once
#include "BeginPrivate.h"
#include "GCUtils.h"
@@ -68,5 +67,3 @@ mark_stack_empty(void)
}
#include "EndPrivate.h"
-
-#endif /* SM_MARKSTACK_H */
diff --git a/rts/sm/MarkWeak.h b/rts/sm/MarkWeak.h
index bd27bf551a..eba1f217c5 100644
--- a/rts/sm/MarkWeak.h
+++ b/rts/sm/MarkWeak.h
@@ -11,8 +11,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef SM_MARKWEAK_H
-#define SM_MARKWEAK_H
+#pragma once
#include "BeginPrivate.h"
@@ -27,5 +26,3 @@ void markWeakPtrList ( void );
void scavengeLiveWeak ( StgWeak * );
#include "EndPrivate.h"
-
-#endif /* SM_MARKWEAK_H */
diff --git a/rts/sm/OSMem.h b/rts/sm/OSMem.h
index 4d158df40d..4a19b348e5 100644
--- a/rts/sm/OSMem.h
+++ b/rts/sm/OSMem.h
@@ -6,8 +6,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef SM_OSMEM_H
-#define SM_OSMEM_H
+#pragma once
#include "BeginPrivate.h"
@@ -88,5 +87,3 @@ void osReleaseHeapMemory(void);
#endif
#include "EndPrivate.h"
-
-#endif /* SM_OSMEM_H */
diff --git a/rts/sm/Sanity.h b/rts/sm/Sanity.h
index 63ae05d2a2..f9f1b3b787 100644
--- a/rts/sm/Sanity.h
+++ b/rts/sm/Sanity.h
@@ -6,8 +6,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef SANITY_H
-#define SANITY_H
+#pragma once
#ifdef DEBUG
@@ -42,5 +41,3 @@ void checkBQ (StgTSO *bqe, StgClosure *closure);
#include "EndPrivate.h"
#endif /* DEBUG */
-
-#endif /* SANITY_H */
diff --git a/rts/sm/Scav.h b/rts/sm/Scav.h
index ddd7d6d2ba..865a78a242 100644
--- a/rts/sm/Scav.h
+++ b/rts/sm/Scav.h
@@ -11,8 +11,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef SM_SCAV_H
-#define SM_SCAV_H
+#pragma once
#include "BeginPrivate.h"
@@ -25,6 +24,3 @@ void scavenge_capability_mut_Lists1 (Capability *cap);
#endif
#include "EndPrivate.h"
-
-#endif /* SM_SCAV_H */
-
diff --git a/rts/sm/ShouldCompact.h b/rts/sm/ShouldCompact.h
index a8ae85df51..bce8ced288 100644
--- a/rts/sm/ShouldCompact.h
+++ b/rts/sm/ShouldCompact.h
@@ -11,8 +11,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef SM_SHOULDCOMPACT_H
-#define SM_SHOULDCOMPACT_H
+#pragma once
#define SHOULDCOMPACT_STATIC 0
#define SHOULDCOMPACT_IN_CNF 1
@@ -22,5 +21,3 @@
#ifndef CMINUSMINUS
extern StgWord shouldCompact (StgCompactNFData *str, StgClosure *p);
#endif
-
-#endif
diff --git a/rts/sm/Storage.h b/rts/sm/Storage.h
index 69901fd6ed..2d69eeed74 100644
--- a/rts/sm/Storage.h
+++ b/rts/sm/Storage.h
@@ -6,8 +6,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef SM_STORAGE_H
-#define SM_STORAGE_H
+#pragma once
#include "Capability.h"
@@ -197,5 +196,3 @@ extern StgIndStatic * debug_caf_list;
extern StgIndStatic * revertible_caf_list;
#include "EndPrivate.h"
-
-#endif /* SM_STORAGE_H */
diff --git a/rts/sm/Sweep.h b/rts/sm/Sweep.h
index b590faa803..02cda8df69 100644
--- a/rts/sm/Sweep.h
+++ b/rts/sm/Sweep.h
@@ -11,9 +11,6 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef SM_SWEEP_H
-#define SM_SWEEP_H
+#pragma once
RTS_PRIVATE void sweep(generation *gen);
-
-#endif /* SM_SWEEP_H */