X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FllvmGen%2FLlvm%2FPpLlvm.hs;h=82c6bfa65e8c64cfe4a9d6e8b690d570f377a32c;hb=769f5c90a96742beec5e1870e68b3c7f21d9e573;hp=b3e2d985b2f455e3aa896fbd08e2aeec3496d56b;hpb=e94570ba7c84444f034b8d552c05f8594532b329;p=ghc-hetmet.git diff --git a/compiler/llvmGen/Llvm/PpLlvm.hs b/compiler/llvmGen/Llvm/PpLlvm.hs index b3e2d98..82c6bfa 100644 --- a/compiler/llvmGen/Llvm/PpLlvm.hs +++ b/compiler/llvmGen/Llvm/PpLlvm.hs @@ -161,6 +161,7 @@ ppLlvmStatement stmt Return result -> ppReturn result Expr expr -> ppLlvmExpression expr Unreachable -> text "unreachable" + Nop -> empty -- | Print out an LLVM expression. @@ -176,6 +177,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 +301,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 --------------------------------------------------------------------------------