mirror of
https://gitlab.com/scemama/irpf90.git
synced 2024-11-12 17:13:42 +01:00
Added -o option to check where the code can be optimized
Version:1.1.41
This commit is contained in:
parent
5fc51c6efb
commit
c9c5f87fdc
@ -1,6 +1,6 @@
|
||||
IRPF90 = irpf90 #-a -d
|
||||
FC = gfortran
|
||||
FCFLAGS= -ffree-line-length-none -O2
|
||||
FCFLAGS= -O2
|
||||
|
||||
SRC=
|
||||
OBJ=
|
||||
|
@ -12,8 +12,5 @@ for i in range(1,6):
|
||||
print " ASSERT ( d%d > d%d )"%(i,i-1)
|
||||
END_SHELL
|
||||
|
||||
print *, &
|
||||
'ceci est un ' &
|
||||
//'test'
|
||||
END_PROVIDER
|
||||
|
||||
|
@ -36,6 +36,7 @@ options['a'] = [ 'assert' , 'Activate assertions', 0 ]
|
||||
options['h'] = [ 'help' , 'Print this help', 0 ]
|
||||
options['i'] = [ 'init' , 'Initialize current directory', 0 ]
|
||||
options['D'] = [ 'define' , 'Define variable', 1 ]
|
||||
options['o'] = [ 'checkopt' , 'Show where optimization may be required', 0 ]
|
||||
options['p'] = [ 'preprocess' , 'Preprocess file', 1 ]
|
||||
|
||||
class CommandLine(object):
|
||||
|
@ -440,6 +440,26 @@ for filename,text in parsed_text:
|
||||
result.append ( (filename,text) )
|
||||
parsed_text = result
|
||||
|
||||
######################################################################
|
||||
from command_line import command_line
|
||||
|
||||
def check_opt():
|
||||
if not command_line.do_checkopt:
|
||||
return
|
||||
|
||||
for filename, text in parsed_text:
|
||||
do_level = 0
|
||||
for vars,line in text:
|
||||
if do_level > 0 and vars != []:
|
||||
print "Optimization: %s line %d"%(line.filename,line.i)
|
||||
for v in vars:
|
||||
print " PROVIDE ",v
|
||||
if isinstance(line,Do):
|
||||
do_level += 1
|
||||
elif isinstance(line,Enddo):
|
||||
do_level -= 1
|
||||
check_opt()
|
||||
|
||||
######################################################################
|
||||
if __name__ == '__main__':
|
||||
for i in range(len(parsed_text)):
|
||||
|
@ -1 +1 @@
|
||||
version = "1.1.40"
|
||||
version = "1.1.41"
|
||||
|
Loading…
Reference in New Issue
Block a user