[start adding support for targeting specific architectures with -march flag.
John Meacham <john@repetae.net>**20061206001006] addfile ./C/Arch.hs
hunk ./C/Arch.hs 1
+{-# OPTIONS_GHC -cpp -fbang-patterns #-}
+module C.Arch(determineArch) where
+
+
+
+{-
+    architecture specification consists of a string of form
+
+    backend-cpu-flags
+
+    where any of the fields may be omitted.
+
+    valid backends are currently "ghc" and "grin", valid cpus are listed in arch/ and 'generic', and flags consist of 32 and 64
+    for instance
+
+    grin-i686
+
+    there are only 2 ghc versions of the backend, ghc-32 and ghc-64.
+
+-}
+
+import Char
+import System.Info
+
+import C.Prims
+import Options
+import Util.Gen
+import qualified FlagOpts as FO
+
+#include "../arch/generic.arch"
+#include "../arch/i686.arch"
+#include "../arch/x86_64.arch"
+
+#include "MachDeps.h"
+
+cpu_alias s = maybe arch_error id $ lookup s' $ [
+    ("unknown","generic"),
+    ("amd64","x86_64"),
+    ("i386","i686"),
+    ("i486","i686"),
+    ("i586","i686")
+    ] ++ [ (n,n) | n <- archs ] where s' = map toLower s
+
+archs = ["generic","i686","x86_64"]
+
+arch_map = [
+    ("generic",Nothing,arch_generic,[]),
+    ("i686",Nothing,arch_i686,[]),
+    ("x86_64",Just 64,arch_x86_64,[]),
+    ("x86_64",Just 32,arch_i686,["-m32"])
+    ]
+
+available_archs = snub $ "ghc":"ghc-64":"ghc-32":[ n | (n,_,_,_) <- arch_map ]  ++ [ n ++ "-" ++ show b |  (n,Just b,_,_) <- arch_map]
+
+determineArch = do
+    let specs = maybe [] (split (== '-')) (optArch options)
+        (backendGhc,specs') | ("ghc":rs) <- specs = (True,rs)
+                            | ("grin":rs) <- specs = (False,rs)
+                            | otherwise = (fopts FO.ViaGhc,specs)
+        (cpu,bits) = case specs' of
+            ["32"] -> (cpu_alias arch,32)
+            ["64"] -> (cpu_alias arch,64)
+            [cpu,"32"] -> (cpu_alias cpu,32)
+            [cpu,"64"] -> (cpu_alias cpu,64)
+            [cpu]      -> (cpu_alias cpu,WORD_SIZE_IN_BITS)
+            []         -> (cpu_alias arch,WORD_SIZE_IN_BITS)
+            _          -> arch_error
+    let (fn,mp,opt) = case (backendGhc,cpu,bits) of
+            (True,!_,32) -> ("ghc-" ++ show bits,arch_i686,[])
+            (True,!_,64) -> ("ghc-" ++ show bits,arch_x86_64,[])
+            (_,"generic",_) -> ("generic",arch_generic,[])
+            (_,"i686",32)   -> ("i686",arch_i686,[])
+            (_,"x86_64",32) -> ("x86_64-32",arch_i686, ["-m32"])
+            (_,"x86_64",64) -> ("x86_64",arch_x86_64,[])
+            _ -> arch_error
+
+    print available_archs
+    print (fn,mp,opt)
+
+arch_error =  error $ "\nunknown architecture, supported architectures are:\n" ++ show available_archs
+
+
+
+
+
hunk ./C/Prims.hs 11
+data PrimTypeType = PrimTypeIntegral | PrimTypeFloating | PrimTypePointer | PrimTypeVoid
+    deriving(Show,Eq,Ord)
+
+data PrimType = PrimType {
+    primTypeName :: ExtType,
+    primTypeType :: PrimTypeType,
+    primTypeAlignmentOf :: Int,
+    primTypeIsSigned :: Bool,
+    primTypeSizeOf :: Int
+    } deriving(Show)
+
hunk ./C/Prims.hs 36
-    | PrimTypeInfo { primArgType :: ExtType,  primRetType :: ExtType, primTypeInfo :: PrimTypeInfo }   -- evaluates to sizeof its argument in bytes
+    | PrimTypeInfo { primArgType :: ExtType,  primRetType :: ExtType, primTypeInfo :: PrimTypeInfo }
hunk ./C/Prims.hs 40
-data PrimTypeInfo = PrimSizeOf | PrimMaxBound | PrimMinBound
+data PrimTypeInfo = PrimSizeOf | PrimMaxBound | PrimMinBound | PrimAlignmentOf | PrimTypeIsSigned
hunk ./Options.hs 68
+    optArch        ::  Maybe String,           -- ^ target architecture
hunk ./Options.hs 100
+    optArch        = Nothing,
hunk ./Options.hs 133
-    , Option ['m'] ["main"]      (ReqArg (optMainFunc_s . Just . (,) False) "Main.main")  "main entry point."
+    , Option []    ["main"]      (ReqArg (optMainFunc_s . Just . (,) False) "Main.main")  "main entry point."
+    , Option ['m'] ["arch"]      (ReqArg (optArch_s . Just ) "arch")            "target architecture."
hunk ./arch/arch.c 5
+#include <stddef.h>
hunk ./arch/arch.c 8
+#include <wctype.h>
hunk ./arch/arch.c 13
-#include "../data/HsFFI.h"
+// #include "../data/HsFFI.h"
+typedef void *HsPtr;
+typedef void (*HsFunPtr)(void);
hunk ./arch/arch.c 17
-#define SIZE(x) fprintf(FP, "  (\"%s\", %i),\n", #x , sizeof(x))
+#define SIGN(x) ((int)((x)(0 - 1) < 0) ? "True" : "False")
+#define FLOAT(x) ((int)(((x)0.1) != 0) ? "PrimTypeFloating" : "PrimTypeIntegral")
+
+#define ALIGN(x) (__alignof__ (x))
+#define SIZE(x) fprintf(FP, "  PrimType {\n    primTypeName = \"%s\",\n    primTypeIsSigned = %s,\n    primTypeType = %s,\n    primTypeAlignmentOf = %i,\n    primTypeSizeOf = %i },\n", #x , SIGN(x), FLOAT(x), ALIGN(x), sizeof(x))
+#define SIZEP(x) fprintf(FP, "  PrimType {\n    primTypeName = \"%s\",\n    primTypeIsSigned = %s,\n    primTypeType = PrimTypePointer,\n    primTypeAlignmentOf = %i,\n    primTypeSizeOf = %i },\n", #x , SIGN(x), ALIGN(x), sizeof(x))
hunk ./arch/arch.c 25
+
hunk ./arch/arch.c 38
-        FP = fopen(str,"w");
+        //FP = fopen(str,"w");
+        FP = stdout;
hunk ./arch/arch.c 61
-        SIZE(HsPtr);
-        SIZE(HsFunPtr);
+        SIZE(long double);
+        SIZEP(HsPtr);
+        SIZEP(HsFunPtr);
hunk ./arch/arch.c 69
+        SIZE(ssize_t);
hunk ./arch/arch.c 72
-        fprintf(FP, "  (\"void\",0)\n ]\n");
+        SIZE(ptrdiff_t);
+        SIZE(time_t);
+        SIZE(wctype_t);
+        SIZE(off_t);
+        fprintf(FP, "  PrimType {\n    primTypeName = \"void\",\n    primTypeIsSigned = False,\n    primTypeType = PrimTypeVoid,\n    primTypeAlignmentOf = 0,\n    primTypeSizeOf = 0 }\n  ]\n\n");
hunk ./arch/arch_hs.prl 1
-
-my @x = `find arch -name \\*.arch`;
-
-
-print @x;
-
-my $body;
-my @a;
-
-foreach (@x) {
-    $body .= "\n";
-    $body .= `cat $_`;
-    s/^arch\///;
-    /^(.*)\.arch$/;
-    my $a = $1;
-    if( $a =~ /i\d86/) {
-
-        push @a,"(\"i386\",Map.fromList arch_${a})";
-        push @a,"(\"i486\",Map.fromList arch_${a})";
-        push @a,"(\"i586\",Map.fromList arch_${a})";
-        push @a,"(\"i686\",Map.fromList arch_${a})";
-
-    }
-    push @a,"(\"$a\",Map.fromList arch_${a})";
-
-}
-
-print "-- This file is generated.\n";
-print "Module Arch(arch_map) where\n\n";
-print "import Data.Map as Map\n\n";
-
-print "arch_map = Map.fromList [" . join(", ",@a) . "]\n\n";
-
-
-
-print $body;
-
-print "\n";
rmfile ./arch/arch_hs.prl
hunk ./arch/generic.arch 1
-
hunk ./arch/generic.arch 2
-  ("uint32_t", 4),
-  ("int8_t", 1),
-  ("int16_t", 2),
-  ("int32_t", 4),
-  ("int64_t", 8),
-  ("uint8_t", 1),
-  ("uint16_t", 2),
-  ("uint32_t", 4),
-  ("uint64_t", 8),
-  ("char", 1),
-  ("void",0)
- ]
+  PrimType {
+    primTypeName = "uint32_t",
+    primTypeIsSigned = False,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 4,
+    primTypeSizeOf = 4 },
+  PrimType {
+    primTypeName = "int8_t",
+    primTypeIsSigned = True,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 1,
+    primTypeSizeOf = 1 },
+  PrimType {
+    primTypeName = "int16_t",
+    primTypeIsSigned = True,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 2,
+    primTypeSizeOf = 2 },
+  PrimType {
+    primTypeName = "int32_t",
+    primTypeIsSigned = True,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 4,
+    primTypeSizeOf = 4 },
+  PrimType {
+    primTypeName = "int64_t",
+    primTypeIsSigned = True,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 8,
+    primTypeSizeOf = 8 },
+  PrimType {
+    primTypeName = "uint8_t",
+    primTypeIsSigned = False,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 1,
+    primTypeSizeOf = 1 },
+  PrimType {
+    primTypeName = "uint16_t",
+    primTypeIsSigned = False,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 2,
+    primTypeSizeOf = 2 },
+  PrimType {
+    primTypeName = "uint32_t",
+    primTypeIsSigned = False,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 4,
+    primTypeSizeOf = 4 },
+  PrimType {
+    primTypeName = "uint64_t",
+    primTypeIsSigned = False,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 8,
+    primTypeSizeOf = 8 },
+  PrimType {
+    primTypeName = "char",
+    primTypeIsSigned = True,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 1,
+    primTypeSizeOf = 1 },
+  PrimType {
+    primTypeName = "void",
+    primTypeIsSigned = False,
+    primTypeType = PrimTypeVoid,
+    primTypeAlignmentOf = 0,
+    primTypeSizeOf = 0 }
+  ]
+
hunk ./arch/i686.arch 2
-  ("uint32_t", 4),
-  ("int", 4),
-  ("intmax_t", 8),
-  ("int8_t", 1),
-  ("int16_t", 2),
-  ("int32_t", 4),
-  ("int64_t", 8),
-  ("intmax_t", 8),
-  ("intptr_t", 4),
-  ("unsigned int", 4),
-  ("uint8_t", 1),
-  ("uint16_t", 2),
-  ("uint32_t", 4),
-  ("uint64_t", 8),
-  ("uintmax_t", 8),
-  ("uintptr_t", 4),
-  ("float", 4),
-  ("double", 8),
-  ("HsPtr", 4),
-  ("HsFunPtr", 4),
-  ("char", 1),
-  ("short", 2),
-  ("int", 4),
-  ("unsigned int", 4),
-  ("size_t", 4),
-  ("wchar_t", 4),
-  ("wint_t", 4),
-  ("void",0)
- ]
+  PrimType {
+    primTypeName = "uint32_t",
+    primTypeIsSigned = False,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 4,
+    primTypeSizeOf = 4 },
+  PrimType {
+    primTypeName = "int",
+    primTypeIsSigned = True,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 4,
+    primTypeSizeOf = 4 },
+  PrimType {
+    primTypeName = "intmax_t",
+    primTypeIsSigned = True,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 8,
+    primTypeSizeOf = 8 },
+  PrimType {
+    primTypeName = "int8_t",
+    primTypeIsSigned = True,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 1,
+    primTypeSizeOf = 1 },
+  PrimType {
+    primTypeName = "int16_t",
+    primTypeIsSigned = True,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 2,
+    primTypeSizeOf = 2 },
+  PrimType {
+    primTypeName = "int32_t",
+    primTypeIsSigned = True,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 4,
+    primTypeSizeOf = 4 },
+  PrimType {
+    primTypeName = "int64_t",
+    primTypeIsSigned = True,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 8,
+    primTypeSizeOf = 8 },
+  PrimType {
+    primTypeName = "intmax_t",
+    primTypeIsSigned = True,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 8,
+    primTypeSizeOf = 8 },
+  PrimType {
+    primTypeName = "intptr_t",
+    primTypeIsSigned = True,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 4,
+    primTypeSizeOf = 4 },
+  PrimType {
+    primTypeName = "unsigned int",
+    primTypeIsSigned = False,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 4,
+    primTypeSizeOf = 4 },
+  PrimType {
+    primTypeName = "uint8_t",
+    primTypeIsSigned = False,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 1,
+    primTypeSizeOf = 1 },
+  PrimType {
+    primTypeName = "uint16_t",
+    primTypeIsSigned = False,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 2,
+    primTypeSizeOf = 2 },
+  PrimType {
+    primTypeName = "uint32_t",
+    primTypeIsSigned = False,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 4,
+    primTypeSizeOf = 4 },
+  PrimType {
+    primTypeName = "uint64_t",
+    primTypeIsSigned = False,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 8,
+    primTypeSizeOf = 8 },
+  PrimType {
+    primTypeName = "uintmax_t",
+    primTypeIsSigned = False,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 8,
+    primTypeSizeOf = 8 },
+  PrimType {
+    primTypeName = "uintptr_t",
+    primTypeIsSigned = False,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 4,
+    primTypeSizeOf = 4 },
+  PrimType {
+    primTypeName = "float",
+    primTypeIsSigned = True,
+    primTypeType = PrimTypeFloating,
+    primTypeAlignmentOf = 4,
+    primTypeSizeOf = 4 },
+  PrimType {
+    primTypeName = "double",
+    primTypeIsSigned = True,
+    primTypeType = PrimTypeFloating,
+    primTypeAlignmentOf = 8,
+    primTypeSizeOf = 8 },
+  PrimType {
+    primTypeName = "HsPtr",
+    primTypeIsSigned = False,
+    primTypeType = PrimTypePointer,
+    primTypeAlignmentOf = 4,
+    primTypeSizeOf = 4 },
+  PrimType {
+    primTypeName = "HsFunPtr",
+    primTypeIsSigned = False,
+    primTypeType = PrimTypePointer,
+    primTypeAlignmentOf = 4,
+    primTypeSizeOf = 4 },
+  PrimType {
+    primTypeName = "char",
+    primTypeIsSigned = True,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 1,
+    primTypeSizeOf = 1 },
+  PrimType {
+    primTypeName = "short",
+    primTypeIsSigned = True,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 2,
+    primTypeSizeOf = 2 },
+  PrimType {
+    primTypeName = "int",
+    primTypeIsSigned = True,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 4,
+    primTypeSizeOf = 4 },
+  PrimType {
+    primTypeName = "unsigned int",
+    primTypeIsSigned = False,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 4,
+    primTypeSizeOf = 4 },
+  PrimType {
+    primTypeName = "size_t",
+    primTypeIsSigned = False,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 4,
+    primTypeSizeOf = 4 },
+  PrimType {
+    primTypeName = "wchar_t",
+    primTypeIsSigned = True,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 4,
+    primTypeSizeOf = 4 },
+  PrimType {
+    primTypeName = "wint_t",
+    primTypeIsSigned = False,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 4,
+    primTypeSizeOf = 4 },
+  PrimType {
+    primTypeName = "void",
+    primTypeIsSigned = False,
+    primTypeType = PrimTypeVoid,
+    primTypeAlignmentOf = 0,
+    primTypeSizeOf = 0 }
+  ]
+
hunk ./arch/x86_64.arch 2
-  ("uint32_t", 4),
-  ("int", 4),
-  ("intmax_t", 8),
-  ("int8_t", 1),
-  ("int16_t", 2),
-  ("int32_t", 4),
-  ("int64_t", 8),
-  ("intmax_t", 8),
-  ("intptr_t", 8),
-  ("unsigned int", 4),
-  ("uint8_t", 1),
-  ("uint16_t", 2),
-  ("uint32_t", 4),
-  ("uint64_t", 8),
-  ("uintmax_t", 8),
-  ("uintptr_t", 8),
-  ("float", 4),
-  ("double", 8),
-  ("HsPtr", 8),
-  ("HsFunPtr", 8),
-  ("char", 1),
-  ("short", 2),
-  ("int", 4),
-  ("unsigned int", 4),
-  ("size_t", 8),
-  ("wchar_t", 4),
-  ("wint_t", 4),
-  ("void",0)
- ]
+  PrimType {
+    primTypeName = "uint32_t",
+    primTypeIsSigned = False,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 4,
+    primTypeSizeOf = 4 },
+  PrimType {
+    primTypeName = "int",
+    primTypeIsSigned = True,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 4,
+    primTypeSizeOf = 4 },
+  PrimType {
+    primTypeName = "intmax_t",
+    primTypeIsSigned = True,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 8,
+    primTypeSizeOf = 8 },
+  PrimType {
+    primTypeName = "int8_t",
+    primTypeIsSigned = True,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 1,
+    primTypeSizeOf = 1 },
+  PrimType {
+    primTypeName = "int16_t",
+    primTypeIsSigned = True,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 2,
+    primTypeSizeOf = 2 },
+  PrimType {
+    primTypeName = "int32_t",
+    primTypeIsSigned = True,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 4,
+    primTypeSizeOf = 4 },
+  PrimType {
+    primTypeName = "int64_t",
+    primTypeIsSigned = True,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 8,
+    primTypeSizeOf = 8 },
+  PrimType {
+    primTypeName = "intmax_t",
+    primTypeIsSigned = True,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 8,
+    primTypeSizeOf = 8 },
+  PrimType {
+    primTypeName = "intptr_t",
+    primTypeIsSigned = True,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 8,
+    primTypeSizeOf = 8 },
+  PrimType {
+    primTypeName = "unsigned int",
+    primTypeIsSigned = False,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 4,
+    primTypeSizeOf = 4 },
+  PrimType {
+    primTypeName = "uint8_t",
+    primTypeIsSigned = False,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 1,
+    primTypeSizeOf = 1 },
+  PrimType {
+    primTypeName = "uint16_t",
+    primTypeIsSigned = False,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 2,
+    primTypeSizeOf = 2 },
+  PrimType {
+    primTypeName = "uint32_t",
+    primTypeIsSigned = False,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 4,
+    primTypeSizeOf = 4 },
+  PrimType {
+    primTypeName = "uint64_t",
+    primTypeIsSigned = False,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 8,
+    primTypeSizeOf = 8 },
+  PrimType {
+    primTypeName = "uintmax_t",
+    primTypeIsSigned = False,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 8,
+    primTypeSizeOf = 8 },
+  PrimType {
+    primTypeName = "uintptr_t",
+    primTypeIsSigned = False,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 8,
+    primTypeSizeOf = 8 },
+  PrimType {
+    primTypeName = "float",
+    primTypeIsSigned = True,
+    primTypeType = PrimTypeFloating,
+    primTypeAlignmentOf = 4,
+    primTypeSizeOf = 4 },
+  PrimType {
+    primTypeName = "double",
+    primTypeIsSigned = True,
+    primTypeType = PrimTypeFloating,
+    primTypeAlignmentOf = 8,
+    primTypeSizeOf = 8 },
+  PrimType {
+    primTypeName = "HsPtr",
+    primTypeIsSigned = False,
+    primTypeType = PrimTypePointer,
+    primTypeAlignmentOf = 8,
+    primTypeSizeOf = 8 },
+  PrimType {
+    primTypeName = "HsFunPtr",
+    primTypeIsSigned = False,
+    primTypeType = PrimTypePointer,
+    primTypeAlignmentOf = 8,
+    primTypeSizeOf = 8 },
+  PrimType {
+    primTypeName = "char",
+    primTypeIsSigned = True,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 1,
+    primTypeSizeOf = 1 },
+  PrimType {
+    primTypeName = "short",
+    primTypeIsSigned = True,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 2,
+    primTypeSizeOf = 2 },
+  PrimType {
+    primTypeName = "int",
+    primTypeIsSigned = True,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 4,
+    primTypeSizeOf = 4 },
+  PrimType {
+    primTypeName = "unsigned int",
+    primTypeIsSigned = False,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 4,
+    primTypeSizeOf = 4 },
+  PrimType {
+    primTypeName = "size_t",
+    primTypeIsSigned = False,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 8,
+    primTypeSizeOf = 8 },
+  PrimType {
+    primTypeName = "wchar_t",
+    primTypeIsSigned = True,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 4,
+    primTypeSizeOf = 4 },
+  PrimType {
+    primTypeName = "wint_t",
+    primTypeIsSigned = False,
+    primTypeType = PrimTypeIntegral,
+    primTypeAlignmentOf = 4,
+    primTypeSizeOf = 4 },
+  PrimType {
+    primTypeName = "void",
+    primTypeIsSigned = False,
+    primTypeType = PrimTypeVoid,
+    primTypeAlignmentOf = 0,
+    primTypeSizeOf = 0 }
+  ]
+