Commit 714cad97 authored by Stefan Behnel's avatar Stefan Behnel

quick way to enable multiple compilation *without* reusing contexts (still...

quick way to enable multiple compilation *without* reusing contexts (still about 10x faster than separate startup)
parent 590350d0
......@@ -405,19 +405,9 @@ def create_default_resultobj(compilation_source, options):
else:
c_suffix = ".c"
result.c_file = Utils.replace_suffix(source_desc.filename, c_suffix)
# The below doesn't make any sense? Why is it there?
c_stat = None
if result.c_file:
try:
c_stat = os.stat(result.c_file)
except EnvironmentError:
pass
return result
def run_pipeline(source, options, full_module_name = None):
# Set up context
context = Context(options.include_path)
def run_pipeline(source, context, options, full_module_name = None):
# Set up source object
cwd = os.getcwd()
source_desc = FileSourceDescriptor(os.path.join(cwd, source))
......@@ -541,7 +531,8 @@ def compile_single(source, options, full_module_name = None):
Always compiles a single file; does not perform timestamp checking or
recursion.
"""
return run_pipeline(source, options, full_module_name)
context = Context(options.include_path)
return run_pipeline(source, context, options, full_module_name)
# context = Context(options.include_path)
# return context.compile(source, options, full_module_name)
......@@ -563,15 +554,15 @@ def compile_multiple(sources, options):
timestamps = recursive
verbose = options.verbose or ((recursive or timestamps) and not options.quiet)
for source in sources:
context = Context(options.include_path) # to be removed later
if source not in processed:
# Compiling multiple sources in one context doesn't quite
# work properly yet.
context = Context(options.include_path) # to be removed later
if not timestamps or context.c_file_out_of_date(source):
if verbose:
sys.stderr.write("Compiling %s\n" % source)
result = context.compile(source, options)
# Compiling multiple sources in one context doesn't quite
# work properly yet.
result = run_pipeline(source, context, options)
results.add(source, result)
processed.add(source)
if recursive:
......@@ -601,10 +592,7 @@ def compile(source, options = None, c_compile = 0, c_link = 0,
and not options.recursive:
return compile_single(source, options, full_module_name)
else:
# Hack it for wednesday dev1
assert len(source) == 1
return compile_single(source[0], options)
# return compile_multiple(source, options)
return compile_multiple(source, options)
#------------------------------------------------------------------------
#
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment