LLVM: Allow getelementptr to use LlvmVar for indexes.
[ghc-hetmet.git] / compiler / llvmGen / Llvm / PpLlvm.hs
index 1a41954..b3e2d98 100644 (file)
@@ -263,9 +263,9 @@ ppAlloca tp amount =
   in text "alloca" <+> texts tp <> comma <+> texts amount'
 
 
-ppGetElementPtr :: Bool -> LlvmVar -> [Int] -> Doc
+ppGetElementPtr :: Bool -> LlvmVar -> [LlvmVar] -> Doc
 ppGetElementPtr inb ptr idx =
-  let indexes = hcat $ map ((comma <+> texts i32 <+>) . texts) idx
+  let indexes = comma <+> ppCommaJoin idx
       inbound = if inb then text "inbounds" else empty
   in text "getelementptr" <+> inbound <+> texts ptr <> indexes