[llvm-commits] [llvm] r127045 - /llvm/trunk/utils/llvmbuild
David Greene
greened at obbligato.org
Fri Mar 4 15:02:52 PST 2011
Author: greened
Date: Fri Mar 4 17:02:52 2011
New Revision: 127045
URL: http://llvm.org/viewvc/llvm-project?rev=127045&view=rev
Log:
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.
Modified:
llvm/trunk/utils/llvmbuild
Modified: llvm/trunk/utils/llvmbuild
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/llvmbuild?rev=127045&r1=127044&r2=127045&view=diff
==============================================================================
--- llvm/trunk/utils/llvmbuild (original)
+++ llvm/trunk/utils/llvmbuild Fri Mar 4 17:02:52 2011
@@ -650,7 +650,8 @@
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 @@
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)
More information about the llvm-commits
mailing list