Commits

Mattias Lundell committed 9db9415

thanks bjorn for the rts fix! works like a charm

  • Participants
  • Parent commits b289044

Comments (0)

Files changed (11)

File examples/Primes.t

 module Primes where
 
-import POSIX 
+import POSIX
 
 root :: World -> Cmd () ()
 root w = do
    env.stdout.write (show ct++"\n")
    env.exit 0
 
-
 primes limit = class
    primesBound = limit `div` log3 limit
 
    count  := 0
 
    isPrime k = loop 0
-      where loop n = do 
+      where loop n = do
               p = primes!n
               if p*p > k then
                  result True
 
    checkFrom k = do
      p <- isPrime k
-     if p then 
+     if p then
         primes!count := k
         count := count + 1
      if k < limit then checkFrom (k+1)
      checkFrom 3
      result count
 
-
 log3 :: Int -> Int
-log3 n  
+log3 n
   | n < 3       = 0
   | otherwise   = 1 + log3 (n `div` 3)

File rtsPOSIX/config.log

 
 hostname = POWERFIST
 uname -m = i686
-uname -r = 2.6.31-20-generic
+uname -r = 2.6.32-21-generic
 uname -s = Linux
-uname -v = #58-Ubuntu SMP Fri Mar 12 05:23:09 UTC 2010
+uname -v = #32-Ubuntu SMP Fri Apr 16 08:10:02 UTC 2010
 
 /usr/bin/uname -p = unknown
 /bin/uname -X     = unknown
 configure:1885: result: gcc
 configure:2117: checking for C compiler version
 configure:2125: gcc --version >&5
-gcc (Ubuntu 4.4.1-4ubuntu9) 4.4.1
+gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3
 Copyright (C) 2009 Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 configure:2136: gcc -v >&5
 Using built-in specs.
 Target: i486-linux-gnu
-Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.1-4ubuntu9' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
+Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.3-4ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
 Thread model: posix
-gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu9) 
+gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) 
 configure:2140: $? = 0
 configure:2147: gcc -V >&5
 gcc: '-V' option must have argument
 configure:2985: result: i686-pc-linux-gnu
 configure:3203: checking for the pthreads library -lpthreads
 configure:3246: gcc -o conftest -g -O2 -m32    conftest.c -lpthreads  >&5
-/usr/bin/ld: cannot find -lpthreads
+/usr/bin/ld: error: cannot find -lpthreads
+/usr/bin/ld: /tmp/ccMSXXR6.o: in function main:conftest.c:12: error: undefined reference to 'pthread_join'
+/usr/bin/ld: /tmp/ccMSXXR6.o: in function main:conftest.c:13: error: undefined reference to '__pthread_register_cancel'
+/usr/bin/ld: /tmp/ccMSXXR6.o: in function main:conftest.c:14: error: undefined reference to 'pthread_create'
+/usr/bin/ld: /tmp/ccMSXXR6.o: in function main:conftest.c:14: error: undefined reference to '__pthread_unregister_cancel'
 collect2: ld returned 1 exit status
 configure:3253: $? = 1
 configure: failed program was:
 configure:3276: result: no
 configure:3148: checking whether pthreads work without any flags
 configure:3246: gcc -o conftest -g -O2 -m32    conftest.c   >&5
-/tmp/ccS7PyBX.o: In function `main':
-/home/capitrane/timber-llvm/rtsPOSIX/conftest.c:12: undefined reference to `pthread_join'
-/home/capitrane/timber-llvm/rtsPOSIX/conftest.c:13: undefined reference to `__pthread_register_cancel'
-/home/capitrane/timber-llvm/rtsPOSIX/conftest.c:14: undefined reference to `pthread_create'
-/home/capitrane/timber-llvm/rtsPOSIX/conftest.c:14: undefined reference to `__pthread_unregister_cancel'
+/usr/bin/ld: /tmp/cctH3OE8.o: in function main:conftest.c:12: error: undefined reference to 'pthread_join'
+/usr/bin/ld: /tmp/cctH3OE8.o: in function main:conftest.c:13: error: undefined reference to '__pthread_register_cancel'
+/usr/bin/ld: /tmp/cctH3OE8.o: in function main:conftest.c:14: error: undefined reference to 'pthread_create'
+/usr/bin/ld: /tmp/cctH3OE8.o: in function main:conftest.c:14: error: undefined reference to '__pthread_unregister_cancel'
 collect2: ld returned 1 exit status
 configure:3253: $? = 1
 configure: failed program was:
 configure:3153: checking whether pthreads work with -Kthread
 configure:3246: gcc -o conftest -g -O2 -m32 -Kthread   conftest.c   >&5
 gcc: unrecognized option '-Kthread'
-/tmp/ccCfvsG6.o: In function `main':
-/home/capitrane/timber-llvm/rtsPOSIX/conftest.c:12: undefined reference to `pthread_join'
-/home/capitrane/timber-llvm/rtsPOSIX/conftest.c:13: undefined reference to `__pthread_register_cancel'
-/home/capitrane/timber-llvm/rtsPOSIX/conftest.c:14: undefined reference to `pthread_create'
-/home/capitrane/timber-llvm/rtsPOSIX/conftest.c:14: undefined reference to `__pthread_unregister_cancel'
+/usr/bin/ld: /tmp/ccB2E7Xc.o: in function main:conftest.c:12: error: undefined reference to 'pthread_join'
+/usr/bin/ld: /tmp/ccB2E7Xc.o: in function main:conftest.c:13: error: undefined reference to '__pthread_register_cancel'
+/usr/bin/ld: /tmp/ccB2E7Xc.o: in function main:conftest.c:14: error: undefined reference to 'pthread_create'
+/usr/bin/ld: /tmp/ccB2E7Xc.o: in function main:conftest.c:14: error: undefined reference to '__pthread_unregister_cancel'
 collect2: ld returned 1 exit status
 configure:3253: $? = 1
 configure: failed program was:
 configure:3153: checking whether pthreads work with -kthread
 configure:3246: gcc -o conftest -g -O2 -m32 -kthread   conftest.c   >&5
 gcc: unrecognized option '-kthread'
-/tmp/cc05uCeg.o: In function `main':
-/home/capitrane/timber-llvm/rtsPOSIX/conftest.c:12: undefined reference to `pthread_join'
-/home/capitrane/timber-llvm/rtsPOSIX/conftest.c:13: undefined reference to `__pthread_register_cancel'
-/home/capitrane/timber-llvm/rtsPOSIX/conftest.c:14: undefined reference to `pthread_create'
-/home/capitrane/timber-llvm/rtsPOSIX/conftest.c:14: undefined reference to `__pthread_unregister_cancel'
+/usr/bin/ld: /tmp/ccPkVDvj.o: in function main:conftest.c:12: error: undefined reference to 'pthread_join'
+/usr/bin/ld: /tmp/ccPkVDvj.o: in function main:conftest.c:13: error: undefined reference to '__pthread_register_cancel'
+/usr/bin/ld: /tmp/ccPkVDvj.o: in function main:conftest.c:14: error: undefined reference to 'pthread_create'
+/usr/bin/ld: /tmp/ccPkVDvj.o: in function main:conftest.c:14: error: undefined reference to '__pthread_unregister_cancel'
 collect2: ld returned 1 exit status
 configure:3253: $? = 1
 configure: failed program was:
 configure:3276: result: no
 configure:3203: checking for the pthreads library -llthread
 configure:3246: gcc -o conftest -g -O2 -m32    conftest.c -llthread  >&5
-/usr/bin/ld: cannot find -llthread
+/usr/bin/ld: error: cannot find -llthread
+/usr/bin/ld: /tmp/ccVhPqnl.o: in function main:conftest.c:12: error: undefined reference to 'pthread_join'
+/usr/bin/ld: /tmp/ccVhPqnl.o: in function main:conftest.c:13: error: undefined reference to '__pthread_register_cancel'
+/usr/bin/ld: /tmp/ccVhPqnl.o: in function main:conftest.c:14: error: undefined reference to 'pthread_create'
+/usr/bin/ld: /tmp/ccVhPqnl.o: in function main:conftest.c:14: error: undefined reference to '__pthread_unregister_cancel'
 collect2: ld returned 1 exit status
 configure:3253: $? = 1
 configure: failed program was:

File rtsPOSIX/rts.c

     return 1;
 }
 
-void init_rts(int argc, char **argv) {
+Ref init_rts(int argc, char **argv) {
+    Ref envObj;
     argc0 = argc;
     argv0 = argv;
 
     pthread_mutexattr_settype(&glob_mutexattr, PTHREAD_MUTEX_NORMAL);
     pthread_mutexattr_setprotocol(&glob_mutexattr, PTHREAD_PRIO_INHERIT);
     pthread_mutex_init(&rts, &glob_mutexattr);
-    
+
     pthread_mutexattr_init(&obj_mutexattr);
     pthread_mutexattr_settype(&obj_mutexattr, PTHREAD_MUTEX_NORMAL);
     pthread_mutexattr_setprotocol(&obj_mutexattr, PTHREAD_PRIO_INHERIT);
-    
+
     prio_min = sched_get_priority_min(SCHED_RR);
     prio_max = sched_get_priority_max(SCHED_RR);
     pthread_key_create(&current_key, NULL);
     sigaddset(&all_sigs, SIGALRM);
     sigaddset(&all_sigs, SIGSELECT);
     pthread_sigmask(SIG_BLOCK, &all_sigs, NULL);
-    
+
     pthread_cond_init(&sleepVar, NULL);
 
     DISABLE(rts);
-    
+
     NCORES = getNumberOfProcessors();
     NTHREADS = NCORES * 4;
     if (NTHREADS > MAXTHREADS)
         NTHREADS = MAXTHREADS;
-    
+
     gcInit();
     gcThread = newThread(NULL, prio_min, garbageCollector, pagesize);
     newThread(NULL, prio_max, timerHandler, pagesize);
 
     ENABLE(rts);
+    NEW (Ref, envObj, WORDS(sizeof(struct Ref)));
+    INITREF(envObj);
+    return envObj;
+
+    //    gcInit();
+    //    gcThread = newThread(NULL, prio_min, garbageCollector, pagesize);
+    //    newThread(NULL, prio_max, timerHandler, pagesize);
+
+    //    ENABLE(rts);
 }
 
 void new(ADDR* addr, size_t words) {
-    //printf("New-call: addr=%x words=%x hp=%x\n", (int)addr, (int)words, (int)hp);
     ADDR top,stop;
     do {
         *addr = hp;

File rtsPOSIX/rts.h

 #error "Can not define CAS on your architecture."
 #endif
 #endif
-/*
+
 #define NEW(t,addr,words)       { ADDR top,stop; \
                                   do { addr = (t)hp; stop = lim; top = ((ADDR)addr)+(words); } \
                                   while (!CAS(addr,top,&hp)); \
                                   if (top>=stop) { addr = (t)force((words),(ADDR)addr<stop?(ADDR)addr:0);} }
-*/
 
+/*
 #define NEW(t,addr,words)       { ADDR tmp; \
                                   new(&tmp,words); \
-                                  addr = (t)tmp; } 
-
+                                  addr = (t)tmp; }
+*/
 // Note: soundness of the spin-loop above depends on the invariant that lim is never changed unless hp also changes.
 
 #define CURRENT()               ((Thread)pthread_getspecific(current_key))
 typedef struct FunList *FunList;
 
 struct FunList {
-  void (*f) (); 
+  void (*f) ();
   FunList next;
 };
 
 Thread newThread(Msg m, int prio, void *(*fun)(void *), int stacksize) ;
 
 // new does the same thing as the macro NEW but as a callable function
-inline void new(ADDR* addr, size_t bytes);
-//void __attribute__((always_inline)) new(ADDR* addr, size_t bytes) ;
+//void new(ADDR* addr, size_t bytes);
+inline void new(ADDR* addr, size_t bytes) __attribute__((always_inline)) ;
 #endif

File src/Execution.hs

 
 compileLLVM global_cfg clo ll_file = do
   let bc_file = rmSuffix ".ll" ll_file ++ ".bc"
-      s_file  = rmSuffix ".ll" (rmDirs ll_file) ++ ".s"
-      o_file  = rmSuffix ".ll" (rmDirs ll_file) ++ ".o"
   res <- checkUpToDate ll_file bc_file
   if not res then do
                cfg <- fileCfg clo ll_file global_cfg
                let cmdLLVMAS = llvmLLVMAS cfg ++ " -f " ++ ll_file
+                   cmdLLVMOPT = llvmOPT cfg
+                                ++ " -mem2reg "
+                                ++ " -std-compile-opts "
+                                ++ " -std-link-opts "
+                                ++ " -strip "
+                                ++ bc_file
+                                ++ " -f -o " ++ bc_file
                putStrLn ("[compiling " ++ ll_file ++ "]")
                execCmd clo cmdLLVMAS
+               execCmd clo cmdLLVMOPT
              else return ()
   where checkUpToDate ll_file bc_file = return False --do
 -- XXX change this, all files are recomiled each time to prevent name clashes when linking
 --                               return (llvm_time <= bc_time)
 --                       else return False
 
-
 -- | Compile a C-file.
 compileC global_cfg clo c_file = do
   let o_file = rmSuffix ".c" (rmDirs c_file) ++ ".o"
   let rootId     = name2str r
       Just rMod = fromMod r
       initId     = "_init_" ++ modToundSc rMod
-      -- link bc_files with libTimber.bc
-      cmd1 = llvmLINK cfg ++ " "
-             ++ unwords bc_files
-             ++ " -o "
-             ++ tmp_bcfile
-      -- apply llvm optimizations
-      cmd2 = llvmOPT cfg
-             ++ " -adce -mem2reg -std-link-opts -std-compile-opts "
-             ++ llvmOptFlags clo ++ " "
-             ++ tmp_bcfile
-             ++ " -f -o "
-             ++ tmp_bcfile
-      -- compile to native code
-      cmd3 = llvmLLC cfg
-             ++ tmp_bcfile ++
-             " -filetype=asm -o "
-             ++ s_file
-      -- link
-      cmd4 = llvmCLANG cfg
-             ++ " -Wno-implicit-function-declaration -internalize "
+      -- create main.bc
+      cmd1 = llvmLLVMAS cfg
+             ++ " main.ll "
+             ++ " -o main.bc"
+      -- link main and program files
+      cmd2 = llvmLD cfg
+             ++ " -Xlinker='-m32' "
+             ++ " -native "
+             ++ " -internalize "
              ++ " -L" ++ rtsDir clo
-             ++ " -m32 -DPOSIX -pthread"
              ++ " -o " ++ outfile clo ++ " "
-             ++ s_file
-             ++ " -DROOT=" ++ rootId
-             ++ " -DROOTINIT=" ++ initId ++ " "
-             ++ rtsMain clo
-             ++ linkLibs cfg
+             ++ " main.bc " ++ unwords bc_files ++ " "
+             ++ " -b " ++ tmp_bcfile ++ " "
+             ++ " -lTimberLLVMLIB "
+             ++ " -lTimberLLVMRTS "
+             ++ " -lpthread"
+  writeFile "main.ll" (llvmMain rMod)
   execCmd clo cmd1
   execCmd clo cmd2
-  execCmd clo cmd3
-  execCmd clo cmd4
 
 -- | Link together a bunch of object files.
 linkO global_cfg clo r o_files =
     base path = case break (`elem` "/.") (reverse path) of
                   (rext,'.':rbase) -> reverse rbase
                   _ -> path
+
+--   \%PTHREAD_MUTEX_T = type {[44 x i8]}\n\
+llvmMain mod =
+  "%Ref = type {i32*, %PTHREAD_MUTEX_T, i32*}\n\
+  \%PTHREAD_MUTEX_T = type {[24 x i8]}\n\
+  \%WORLD = type {opaque}\n\
+  \declare void @_init_"++ mod ++ "()\n\
+  \declare void @root_" ++ mod ++ "(%WORLD*, %Ref*)\n\
+  \declare %Ref* @init_rts(i32, i8**)\n\
+  \declare void @pruneStaticHeap()\n\
+  \declare i32 @sleep_rts()\n\n\
+  \define i32 @main(i32 %argc, i8** %argv) nounwind {\n\
+  \  entry:\n\
+  \  %envObj =tail call %Ref* @init_rts(i32 %argc, i8** %argv) nounwind\n\
+  \  tail call void @_init_" ++ mod ++ "() nounwind\n\
+  \  tail call void @pruneStaticHeap() nounwind\n\
+  \  tail call void @root_" ++ mod ++ "(%WORLD* null, %Ref* %envObj) nounwind\n\
+  \  tail call i32 @sleep_rts() nounwind\n\
+  \  ret i32 0\n\
+  \}\n"

File src/Kindle2LLVM.hs

                         | n == n' = return reg
                         | n > n'  = trunc totyp reg
                 Tvector _ _ -> bitcast totype r1
+                Tfloat -> sitofp float r1
+                x -> fail (show x)
     Tvector _ _ -> case totype of
                      Tint _ -> bitcast totype r1
                      Tptr _ -> bitcast int r1 >>= inttoptr totype

File src/Kindlered.hs

                                    }
 -}
 
+isTailRecursive f (CBind False [(_, Val t (ECall g _ _))] (CRet (ENew (Tuple 0 _) _ _)))
+  | t == tUNIT                          = f == g
 isTailRecursive f (CRet (ECall g _ _))  = f == g
 isTailRecursive f (CRun _ c)            = isTailRecursive f c
 isTailRecursive f (CBind _ _ c)         = isTailRecursive f c
 isTailRecursiveAlt f (ALit _ c)         = isTailRecursive f c
 isTailRecursiveAlt f (AWild c)          = isTailRecursive f c
 
-
+redTailCall x vs (CBind False [(_, Val t (ECall y ts es))] (CRet (ENew (Tuple 0 _) _ _)))
+  | t == tUNIT && x == y                = updateParams vs es
 redTailCall f vs (CRet (ECall g _ es))
   | f == g                              = updateParams vs es
 redTailCall f vs (CBind r bs c)         = liftM (CBind r bs) (redTailCall f vs c)
               | Topaque
               | Tstruct String
               | Tvector Int LLVMType
-              | Tunion [LLVMType]
                 deriving (Eq, Ord)
 
 instance Show LLVMType where
     show (Tstruct sname)     = '%' : sname
     show Topaque             = "opaque"
     show (Tvector nelem typ) = "<" ++ show nelem ++ " x " ++ show typ ++ ">"
-    show (Tunion typs)       =
-        "union {" ++ intercalate ", " (map show typs) ++ "}"
     show (Tfun rettyp args)  =
         show rettyp ++ " (" ++ intercalate ", " (map show args) ++ ")"
 
+{-
 data LLVMParameterAttribute = Zeroext
                             | Signext
                             | Inreg
                             | Noalias
                             | Nocapture
                             | Nest
-
+-}
+{-
 instance Show LLVMParameterAttribute where
     show Zeroext   = "zeroext"
     show Signext   = "signext"
     show Noalias   = "noalias"
     show Nocapture = "nocapture"
     show Nest      = "nest"
-
+-}
+{-
 data LLVMFunctionAttributes = Alwaysinline
                             | Inlinehint
                             | Noinline
                             | Noredzone
                             | Noimplicitfloat
                             | Naked
-
+-}
+{-
 instance Show LLVMFunctionAttributes where
     show Alwaysinline    = "alwaysinline"
     show Inlinehint      = "inlinehint"
     show Noredzone       = "noredzone"
     show Noimplicitfloat = "noimplicitfloat"
     show Naked           = "naked"
+-}
 
-data LLVMGlobalInitializer = Zeroinitializer | Null deriving (Eq)
+data LLVMGlobalInit = Zeroinitializer | Null deriving (Eq)
 
-instance Show LLVMGlobalInitializer where
+instance Show LLVMGlobalInit where
     show Zeroinitializer = "zeroinitializer"
     show Null            = "null"
 
                | LLVMConstant LLVMType ConstValue
                  deriving (Eq,Show)
 
-data LLVMRegisterTag = TagGlobal [LLVMLinkage] (Maybe LLVMGlobalInitializer)
+data LLVMRegisterTag = TagGlobal [LLVMLinkage] (Maybe LLVMGlobalInit)
                      | TagLocal
                        deriving (Eq, Show)
 

File src/LLVMKindle.hs

 struct :: String -> LLVMType
 struct = Tstruct
 
-union :: [LLVMType] -> LLVMType
-union = Tunion
-
 array :: Int -> LLVMType -> LLVMType
 array = Tarray
 
 icmp = emitCmpOp Icmp
 fcmp = emitCmpOp Fcmp
 
-bitcast  = emitCast Bitcast 
+bitcast  = emitCast Bitcast
 ptrtoint = emitCast Ptrtoint
 inttoptr = emitCast Inttoptr
 sitofp   = emitCast Sitofp
 fptosi   = emitCast Fptosi
 trunc typ@(Tint n) op1 = do
   let (Tint n') = getTyp op1
-  if n == n' 
-     then return op1 
+  if n == n'
+     then return op1
      else do
        r1 <- getNewReg typ
        emit $ Trunc r1 op1 typ
        return r1
 zext typ@(Tint n) op1 = do
   let (Tint n') = getTyp op1
-  if n == n' 
-     then return op1 
+  if n == n'
+     then return op1
      else do
        r1 <- getNewReg typ
        emit $ Zext r1 op1 typ
   let (Tvector _ typ) = getTyp op1
   r1 <- getNewReg typ
   emit $ Extractelement r1 op1 op2
-  return r1           
+  return r1
 insertelement  op1 op2 op3 = do
   r1 <- getNewReg (getTyp op1)
   emit $ Insertelement r1 op1 op2 op3
                    TCon (Prim Time _) _       -> timestruct
                    TCon (Prim TIMERTYPE _) _  -> timerstruct
                    TCon (Prim AbsTime _) _    -> struct "AbsTime"
-                   TCon (Prim World _) _      -> worldstruct 
+                   TCon (Prim World _) _      -> worldstruct
                    TCon (Prim Array _) _      -> arraystruct
                    TCon (Tuple 0 _) _         -> tup0struct
                    TCon (Tuple 2 _) _         -> tup2struct
                    TCon (Prim LEFT _)_        -> leftstruct
                    TCon (Prim RIGHT _)_       -> rightstruct
                    TCon name@(Name _ _ _ _) _ -> ptr $ struct (k2llvmName name)
-                   _                          -> error $ "ERROR IN k2llvmType: " ++ show typ   
+                   _                          -> error $ "ERROR IN k2llvmType: " ++ show typ
 
 -- Transform Name data to string
 k2llvmName :: Name -> String
 k2llvmName (Name s t _ _)
   | t == 0 = s
 k2llvmName (Name s t m a)       = id ++ tag ++ mod
-  where 
+  where
     id                          = if okForC s then s else "_sym"
     tag                         = if mod=="" || generated a || id=="_sym" then '_':show t else ""
     mod                         = maybe "" (('_' :) . modToundSc) m

File src/LLVMPP.hs

 instance PP [LLVMLinkage] where
     pp linkage = hcat $ punctuate (text " ") (map (text.show) linkage)
 
-instance PP LLVMGlobalInitializer where
+instance PP LLVMGlobalInit where
     pp init = text $ show init
 
 instance PP LLVMFunctionDecl where

File tests/ArrayTest.t

         where
         show0 x curr last 
             | curr == last  = show (x!curr)
-            | otherwise     = show (x!curr) ++ "," ++ show0 x (curr+1) last
+            | otherwise     = show (x!curr) ++ "," ++ show0 x (curr+1) last