summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2011-10-19 01:58:54 +0100
committerIan Lynagh <igloo@earth.li>2011-10-19 01:58:54 +0100
commit013a3e3b79a86e377c6c94b34f6313d58363c6b3 (patch)
tree744507d686cfcc657dc39ca0ece5c88ded541eb5
parent5ab74eb767e42a897f16b5872cac9e3462612ee7 (diff)
downloadhaskell-013a3e3b79a86e377c6c94b34f6313d58363c6b3.tar.gz
Revert "Remove OSUnknown"
This reverts commit f75f26cc4eed3c3cfc256ebfb9e77b8e82a766fc. On second thoughts, this does make sense, for unregisterised via-C OSes at least.
-rw-r--r--compiler/nativeGen/PPC/CodeGen.hs1
-rw-r--r--compiler/utils/Platform.hs9
2 files changed, 7 insertions, 3 deletions
diff --git a/compiler/nativeGen/PPC/CodeGen.hs b/compiler/nativeGen/PPC/CodeGen.hs
index a01fa1b55e..4bde8efd5b 100644
--- a/compiler/nativeGen/PPC/CodeGen.hs
+++ b/compiler/nativeGen/PPC/CodeGen.hs
@@ -853,6 +853,7 @@ genCCall target dest_regs argsAndHints
OSMinGW32 -> panic "PPC.CodeGen.genCCall: not defined for this os"
OSFreeBSD -> panic "PPC.CodeGen.genCCall: not defined for this os"
OSOpenBSD -> panic "PPC.CodeGen.genCCall: not defined for this os"
+ OSUnknown -> panic "PPC.CodeGen.genCCall: not defined for this os"
data GenCCallPlatform = GCPLinux | GCPDarwin
diff --git a/compiler/utils/Platform.hs b/compiler/utils/Platform.hs
index 7446fc1099..362d7822d0 100644
--- a/compiler/utils/Platform.hs
+++ b/compiler/utils/Platform.hs
@@ -48,9 +48,11 @@ data Arch
deriving (Show, Eq)
--- | Operating systems that we know about.
+-- | Operating systems that the native code generator knows about.
+-- Having OSUnknown should produce a sensible default, but no promises.
data OS
- = OSLinux
+ = OSUnknown
+ | OSLinux
| OSDarwin
| OSSolaris2
| OSMinGW32
@@ -94,6 +96,7 @@ osElfTarget OSOpenBSD = True
osElfTarget OSSolaris2 = True
osElfTarget OSDarwin = False
osElfTarget OSMinGW32 = False
+osElfTarget OSUnknown = panic "Don't know if OSUnknown is elf"
-- | This is the target platform as far as the #ifdefs are concerned.
@@ -139,7 +142,7 @@ defaultTargetOS = OSFreeBSD
#elif openbsd_TARGET_OS
defaultTargetOS = OSOpenBSD
#else
-#error Unknown OS
+defaultTargetOS = OSUnknown
#endif
#if arm_TARGET_ARCH