Export - define ProGenDef outside of the loop

This saves ~329 calls.
pull/2202/head
0xc0170 2016-07-21 09:41:38 +01:00
parent 48c1d2eb7a
commit 3f5c794b6c
3 changed files with 9 additions and 6 deletions

View File

@ -39,10 +39,11 @@ class IAREmbeddedWorkbench(Exporter):
def TARGETS(cls):
if not hasattr(cls, "_targets_supported"):
cls._targets_supported = []
progendef = ProGenDef('iar')
for target in TARGET_NAMES:
try:
if (ProGenDef('iar').is_supported(str(TARGET_MAP[target])) or
ProGenDef('iar').is_supported(TARGET_MAP[target].progen['target'])):
if (progendef.is_supported(str(TARGET_MAP[target])) or
progendef.is_supported(TARGET_MAP[target].progen['target'])):
cls._targets_supported.append(target)
except AttributeError:
# target is not supported yet

View File

@ -39,10 +39,11 @@ class Uvision4(Exporter):
def TARGETS(cls):
if not hasattr(cls, "_targets_supported"):
cls._targets_supported = []
progendef = ProGenDef('uvision')
for target in TARGET_NAMES:
try:
if (ProGenDef('uvision').is_supported(str(TARGET_MAP[target])) or
ProGenDef('uvision').is_supported(TARGET_MAP[target].progen['target'])):
if (progendef.is_supported(str(TARGET_MAP[target])) or
progendef.is_supported(TARGET_MAP[target].progen['target'])):
cls._targets_supported.append(target)
except AttributeError:
# target is not supported yet

View File

@ -39,10 +39,11 @@ class Uvision5(Exporter):
def TARGETS(cls):
if not hasattr(cls, "_targets_supported"):
cls._targets_supported = []
progendef = ProGenDef('uvision5')
for target in TARGET_NAMES:
try:
if (ProGenDef('uvision5').is_supported(str(TARGET_MAP[target])) or
ProGenDef('uvision5').is_supported(TARGET_MAP[target].progen['target'])):
if (progendef.is_supported(str(TARGET_MAP[target])) or
progendef.is_supported(TARGET_MAP[target].progen['target'])):
cls._targets_supported.append(target)
except AttributeError:
# target is not supported yet