From 05782f6fcab6d2d2b56714c0980417827e2d00a7 Mon Sep 17 00:00:00 2001 From: cfreksen Date: Sun, 29 Oct 2017 18:23:12 +0100 Subject: [PATCH] Use a dictionary to store named blocks. --- parser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/parser.py b/parser.py index eb626ef..ba292cb 100644 --- a/parser.py +++ b/parser.py @@ -315,7 +315,8 @@ class LLVMParser(object): def p_fbody_multiple_blocks(self, p): 'fbody : block named_block_list' - p[0] = ll.FunctionBody(p[1], p[2]) + named_blocks = {label: block for (label, block) in p[2]} + p[0] = ll.FunctionBody(p[1], named_blocks) def p_fbody_one_block(self, p): 'fbody : block'