From 0f279cd3f0b9f69a91040f04672f28395c3c6df9 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 21 Aug 2018 15:57:51 +0900 Subject: [PATCH] Add a comment about fake statement numbers. I had forgotten how they worked (not surprising after 6 years). --- tools/qfcc/source/flow.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/qfcc/source/flow.c b/tools/qfcc/source/flow.c index 45dcbf5c9..2b45708cc 100644 --- a/tools/qfcc/source/flow.c +++ b/tools/qfcc/source/flow.c @@ -377,6 +377,17 @@ flow_build_vars (function_t *func) set_add (func->global_vars, i); } // create dummy defs for local vars + // defined local vars add their address in local space to the number of + // statements in the function: + // ([num_statements ... num_statements+localsize]) + // with a set element for each def used in the local space + // + // temporary vars add their var number to the size of the local space + // before adding the number of statements in the function: + // ([num_statements+localsize ... num_vars]) + // temporary vars are always accessed as a full var, so only one set + // element per temporary var is needed. This can lead to holes in the + // temporary var set element space, but it does keep things simple for (i = 0; i < func->num_vars; i++) { int offset, size; int j;