IRP_ALIGN introduced

This commit is contained in:
Anthony Scemama 2012-12-07 15:12:10 +01:00
parent 017cbcb43f
commit 91ac0ac940
4 changed files with 9 additions and 7 deletions

View File

@ -43,7 +43,7 @@ options['g'] = [ 'profile' , 'Generate profile code', 0 ]
options['t'] = [ 'touch' , 'Display which entities are touched', 1 ]
options['m'] = [ 'memory' , 'Debug memory info', 0 ]
options['z'] = [ 'openmp' , 'Automatic openMP tasks (may not work)', 0 ]
options['l'] = [ 'align' , 'Align arrays using compiler directives', 1 ]
options['l'] = [ 'align' , 'Align arrays using compiler directives. Sets the $IRP_ALIGN variable', 1 ]
options['s'] = [ 'substitute' , 'Substitute values for loop max values', 1 ]
options['r'] = [ 'no_directives', 'Ignore compiler directives !DEC$ and !DIR$', 0 ]
options['n'] = [ 'inline' , 'all|providers|builders : Force inlining of providers or builders', 1 ]
@ -106,10 +106,10 @@ class CommandLine(object):
def align(self):
if '_align' not in self.__dict__:
self._align = 0
self._align = '1'
for o,a in self.opts:
if o in [ "-l", '--'+options['l'][0] ]:
self._align = int(a)
self._align = a
return self._align
align = property(fget=align)

View File

@ -526,7 +526,7 @@ def perform_loop_substitutions():
result = []
append = result.append
for vars,line in text:
if type(line) in [ Do, If, Elseif] :
if type(line) in [ Do, If, Elseif ] :
for k,v in command_line.substituted.items():
reg = v[1]
while reg.search(line.text) is not None:

View File

@ -96,8 +96,9 @@ def get_type (i, filename, line, is_doc):
assert type(is_doc) == bool
line = line.rstrip()
line = line.replace("$IRP_ALIGN",command_line.align)
lower_line0 = line.lstrip().lower()
lower_line = lower_line0.replace("!"," ! ")
lower_line = lower_line0.replace("!"," ! ")
# Replacements
lower_line = re_elseif.sub("elseif",lower_line)
@ -106,6 +107,7 @@ def get_type (i, filename, line, is_doc):
lower_line = re_endmodule.sub("endmodule",lower_line)
lower_line = re_endif.sub("endif",lower_line)
lower_line = re_endselect.sub("endselect",lower_line)
for c in """()'"[]""":
lower_line = lower_line.replace(c," "+c+" ")

View File

@ -233,8 +233,8 @@ class Variable(object):
if '_header' not in self.__dict__:
name = self.name
self._header = [ " %s :: %s %s"%(self.type, name, build_dim_colons(self) ) ]
if self.dim != [] and command_line.align > 0:
self._header += [" !DIR$ ATTRIBUTES ALIGN: %d :: %s"%(command_line.align,name)]
if self.dim != [] and command_line.align != '1':
self._header += [" !DIR$ ATTRIBUTES ALIGN: %s :: %s"%(command_line.align,name)]
if self.is_main:
self._header += [ " logical :: %s_is_built = .False."%(name) ]
return self._header