X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FllvmGen%2FLlvm%2FPpLlvm.hs;fp=compiler%2FllvmGen%2FLlvm%2FPpLlvm.hs;h=1a972e74fe500bce87a234a55b106706634422fe;hp=b3e2d985b2f455e3aa896fbd08e2aeec3496d56b;hb=1c59af0bf4fbd699aafd71082e6ba6d373b59c23;hpb=5d2f6a5323df8586c6534a50ebd6f06f1bf19109 diff --git a/compiler/llvmGen/Llvm/PpLlvm.hs b/compiler/llvmGen/Llvm/PpLlvm.hs index b3e2d98..1a972e7 100644 --- a/compiler/llvmGen/Llvm/PpLlvm.hs +++ b/compiler/llvmGen/Llvm/PpLlvm.hs @@ -176,6 +176,7 @@ ppLlvmExpression expr Load ptr -> ppLoad ptr Malloc tp amount -> ppMalloc tp amount Phi tp precessors -> ppPhi tp precessors + Asm asm c ty v se sk -> ppAsm asm c ty v se sk -------------------------------------------------------------------------------- @@ -299,6 +300,18 @@ ppSwitch scrut dflt targets = <+> ppTargets targets +ppAsm :: LMString -> LMString -> LlvmType -> [LlvmVar] -> Bool -> Bool -> Doc +ppAsm asm constraints rty vars sideeffect alignstack = + let asm' = doubleQuotes $ ftext asm + cons = doubleQuotes $ ftext constraints + rty' = texts rty + vars' = lparen <+> ppCommaJoin vars <+> rparen + side = if sideeffect then text "sideeffect" else empty + align = if alignstack then text "alignstack" else empty + in text "call" <+> rty' <+> text "asm" <+> side <+> align <+> asm' <> comma + <+> cons <> vars' + + -------------------------------------------------------------------------------- -- * Misc functions --------------------------------------------------------------------------------