From 45e9beb276ea4937cde20f694db39260587d9db6 Mon Sep 17 00:00:00 2001 From: Michael Hayes Date: Sat, 27 Aug 2011 01:49:46 +0000 Subject: [PATCH] Check for use before def --- etc/makemake.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/etc/makemake.py b/etc/makemake.py index 1e10a87..6761565 100755 --- a/etc/makemake.py +++ b/etc/makemake.py @@ -238,7 +238,7 @@ def functions_find (gcc, filepath, functiondeps = {}): text = file.readlines () file.close () - func_def = None + function = None for line in text: #print >> sys.stderr, line matches = re.findall (r'^(.*)\s[(][)]', line) @@ -249,7 +249,10 @@ def functions_find (gcc, filepath, functiondeps = {}): matches = re.findall (r'.*gimple_call [<]([\w]*)[,]', line) if matches: # print >> sys.stderr, 'USE', matches[0] - functiondeps[function].append (matches[0]) + if function: + functiondeps[function].append (matches[0]) + else: + print >> sys.stderr, matches[0], 'used outside function", command = 'rm ' + rtlfilename # print >> sys.stderr, command