From 5fecd767309f318e0ec6797667ca6442a54ea451 Mon Sep 17 00:00:00 2001 From: Peter Wortmann Date: Sat, 6 Dec 2014 17:11:42 +0100 Subject: Tick scopes This patch solves the scoping problem of CmmTick nodes: If we just put CmmTicks into blocks we have no idea what exactly they are meant to cover. Here we introduce tick scopes, which allow us to create sub-scopes and merged scopes easily. Notes: * Given that the code often passes Cmm around "head-less", we have to make sure that its intended scope does not get lost. To keep the amount of passing-around to a minimum we define a CmmAGraphScoped type synonym here that just bundles the scope with a portion of Cmm to be assembled later. * We introduce new scopes at somewhat random places, aligning with getCode calls. This works surprisingly well, but we might have to add new scopes into the mix later on if we find things too be too coarse-grained. (From Phabricator D169) --- compiler/nativeGen/X86/CodeGen.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'compiler/nativeGen/X86/CodeGen.hs') diff --git a/compiler/nativeGen/X86/CodeGen.hs b/compiler/nativeGen/X86/CodeGen.hs index 9e705c87f9..7c0ba2d4da 100644 --- a/compiler/nativeGen/X86/CodeGen.hs +++ b/compiler/nativeGen/X86/CodeGen.hs @@ -111,7 +111,8 @@ basicBlockCodeGen , [NatCmmDecl (Alignment, CmmStatics) Instr]) basicBlockCodeGen block = do - let (CmmEntry id, nodes, tail) = blockSplit block + let (_, nodes, tail) = blockSplit block + id = entryLabel block stmts = blockToList nodes mid_instrs <- stmtsToInstrs stmts tail_instrs <- stmtToInstrs tail -- cgit v1.2.1