summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2011-03-04 23:02:52 +0000
committerDavid Greene <greened@obbligato.org>2011-03-04 23:02:52 +0000
commit9e8963acfdb7ab91962e457434f85689daa2237c (patch)
tree2c19b0406d72f935b47dd106605535fb702663c3
parent874472584de15f371c297044fd842f3bf59f29c1 (diff)
downloadbcm5719-llvm-9e8963acfdb7ab91962e457434f85689daa2237c.tar.gz
bcm5719-llvm-9e8963acfdb7ab91962e457434f85689daa2237c.zip
Fix the case where the number of jobs is less than the
number of threads. In that case make the number of threads equal to the number of jobs and launch one jobs on each thread. This makes things work like make -j. llvm-svn: 127045
-rwxr-xr-xllvm/utils/llvmbuild15
1 files changed, 12 insertions, 3 deletions
diff --git a/llvm/utils/llvmbuild b/llvm/utils/llvmbuild
index fb8500d38ef..5912c50ddfe 100755
--- a/llvm/utils/llvmbuild
+++ b/llvm/utils/llvmbuild
@@ -650,7 +650,8 @@ class Builder(threading.Thread):
def configure(self, component, srcdir, builddir, flags, env):
- self.logger.debug("Configure " + str(flags))
+ self.logger.debug("Configure " + str(flags) + " " + str(srcdir) + " -> "
+ + str(builddir))
configure_files = dict(
llvm=[(srcdir + "/configure", builddir + "/Makefile")],
@@ -721,8 +722,16 @@ branch_abbrev = get_path_abbrevs(set(options.branch))
work_queue = queue.Queue()
-for t in range(options.threads):
- jobs = options.jobs // options.threads
+jobs = options.jobs // options.threads
+if jobs == 0:
+ jobs = 1
+
+numthreads = options.threads
+if jobs < numthreads:
+ numthreads = jobs
+ jobs = 1
+
+for t in range(numthreads):
builder = Builder(work_queue, jobs,
build_abbrev, source_abbrev, branch_abbrev,
options)
OpenPOWER on IntegriCloud