Check for use before def
This commit is contained in:
+5
-2
@@ -238,7 +238,7 @@ def functions_find (gcc, filepath, functiondeps = {}):
|
|||||||
text = file.readlines ()
|
text = file.readlines ()
|
||||||
file.close ()
|
file.close ()
|
||||||
|
|
||||||
func_def = None
|
function = None
|
||||||
for line in text:
|
for line in text:
|
||||||
#print >> sys.stderr, line
|
#print >> sys.stderr, line
|
||||||
matches = re.findall (r'^(.*)\s[(][)]', 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)
|
matches = re.findall (r'.*gimple_call [<]([\w]*)[,]', line)
|
||||||
if matches:
|
if matches:
|
||||||
# print >> sys.stderr, 'USE', matches[0]
|
# 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
|
command = 'rm ' + rtlfilename
|
||||||
# print >> sys.stderr, command
|
# print >> sys.stderr, command
|
||||||
|
|||||||
Reference in New Issue
Block a user