platform/upstream/ninja.git
8 years agoput warning flags together
Evan Martin [Tue, 17 Nov 2015 22:23:13 +0000 (14:23 -0800)]
put warning flags together

8 years agoMerge pull request #1052 from ninja-build/docs
Nico Weber [Tue, 17 Nov 2015 22:20:12 +0000 (14:20 -0800)]
Merge pull request #1052 from ninja-build/docs

Minor doc fixes

8 years agodrop a [horizontal] definition table
Evan Martin [Tue, 17 Nov 2015 22:13:44 +0000 (14:13 -0800)]
drop a [horizontal] definition table

The two columns of the table run together, making it hard to read.

8 years agoimprove docs generation, including PDF output
Evan Martin [Tue, 17 Nov 2015 22:04:50 +0000 (14:04 -0800)]
improve docs generation, including PDF output

- Fix the manual build rules (missing the .xsl as an input).
- Add a README describing how the docs build works.
- Add rules that generate PDF, just 'cause we can.

8 years agoprovide a better title for the manual
Evan Martin [Tue, 17 Nov 2015 22:02:43 +0000 (14:02 -0800)]
provide a better title for the manual

In particular, this helps web search engines index it.

8 years agoMerge pull request #1047 from pykello/master
Nico Weber [Thu, 12 Nov 2015 05:46:33 +0000 (21:46 -0800)]
Merge pull request #1047 from pykello/master

Speed-up bash target auto-complete.

8 years agoMerge pull request #1046 from zed0/master
Nico Weber [Thu, 12 Nov 2015 05:46:19 +0000 (21:46 -0800)]
Merge pull request #1046 from zed0/master

Speed up zsh target completion

8 years agoFix indent in pull request #1042.
Alex Vallee [Thu, 12 Nov 2015 03:48:39 +0000 (22:48 -0500)]
Fix indent in pull request #1042.

8 years agoMerge pull request #1007 from mikesep/aix
Evan Martin [Thu, 12 Nov 2015 01:19:00 +0000 (17:19 -0800)]
Merge pull request #1007 from mikesep/aix

Support for AIX

8 years agoMerge pull request #999 from colincross/dumbstatus
Nico Weber [Thu, 12 Nov 2015 01:13:30 +0000 (17:13 -0800)]
Merge pull request #999 from colincross/dumbstatus

Print status when edge finishes on dumb terminals

8 years agoMerge pull request #964 from nicolasdespres/sighup
Nico Weber [Thu, 12 Nov 2015 00:51:29 +0000 (16:51 -0800)]
Merge pull request #964 from nicolasdespres/sighup

Cleanup build on SIGHUP.

8 years agoMerge pull request #763 from drbo/master
Nico Weber [Thu, 12 Nov 2015 00:34:38 +0000 (16:34 -0800)]
Merge pull request #763 from drbo/master

Allow paths with international characters in depfiles

8 years agoTry to fix #685
Nico Weber [Wed, 11 Nov 2015 21:54:14 +0000 (13:54 -0800)]
Try to fix #685

8 years agodrop more references to github/martine
Evan Martin [Wed, 11 Nov 2015 21:34:13 +0000 (13:34 -0800)]
drop more references to github/martine

8 years agoUpdate link to point to ninja-build.org
Nico Weber [Wed, 11 Nov 2015 21:27:16 +0000 (13:27 -0800)]
Update link to point to ninja-build.org

8 years agoMerge pull request #1049 from nico/update-links
Nico Weber [Wed, 11 Nov 2015 19:54:07 +0000 (11:54 -0800)]
Merge pull request #1049 from nico/update-links

Make links point to org page

8 years agoMake links point to org page
Nico Weber [Wed, 11 Nov 2015 19:53:15 +0000 (11:53 -0800)]
Make links point to org page

8 years agotest commit
Nico Weber [Wed, 11 Nov 2015 19:36:16 +0000 (11:36 -0800)]
test commit

8 years agoSpeed-up bash target auto-complete.
Hadi Moshayedi [Sat, 31 Oct 2015 10:13:33 +0000 (06:13 -0400)]
Speed-up bash target auto-complete.

These speed-ups include:

* Let compgen do the command substitution. Similar to
  https://lists.gnu.org/archive/html/bug-bash/2012-03/msg00115.html
* Use "cut" instead of "awk" for separating fields.

8 years agoSpeed up zsh target completion
Ben Falconer [Fri, 30 Oct 2015 14:43:32 +0000 (14:43 +0000)]
Speed up zsh target completion

8 years agoFix wrapping file paths in Writer.comment
Alex Vallée [Fri, 23 Oct 2015 20:36:28 +0000 (16:36 -0400)]
Fix wrapping file paths in Writer.comment

Long file names, especially with hyphens will get incorrectly wrapped by
the comment method. Pass has_path=True to prevent this type of wrapping.

This is mainly so that longer path names can show up in comments on
their on line without breaking them up.

8 years agoSeparate bootstrapped build from final build
Mike Seplowitz [Wed, 21 Oct 2015 22:37:50 +0000 (18:37 -0400)]
Separate bootstrapped build from final build

AIX does not support rebuilding ninja in-place from the bootstrapped ninja.

8 years agoMerge pull request #1015 from moroten/docs-relpath
Nico Weber [Thu, 22 Oct 2015 03:07:02 +0000 (20:07 -0700)]
Merge pull request #1015 from moroten/docs-relpath

Describe why to use relative paths

8 years agoMerge pull request #1040 from peter1000/patch-1
Nico Weber [Thu, 22 Oct 2015 01:49:56 +0000 (18:49 -0700)]
Merge pull request #1040 from peter1000/patch-1

Fixes typo

8 years agoMerge pull request #1029 from nicolasdespres/fix-doc-typo
Nico Weber [Wed, 21 Oct 2015 23:35:03 +0000 (16:35 -0700)]
Merge pull request #1029 from nicolasdespres/fix-doc-typo

Fix typo.

8 years agoFixes typo
peter1000 [Mon, 19 Oct 2015 20:44:30 +0000 (18:44 -0200)]
Fixes typo

8 years agoPrint output file on failure
Colin Cross [Mon, 5 Oct 2015 21:17:56 +0000 (14:17 -0700)]
Print output file on failure

Modify the FAILED: output to provide the output files that failed to
build, followed by the failed command on the next line.  This makes the
failure much easier to read, as you can immediately see much shorter
name of the file that failed instead of trying to parse a very long
command line.  It also makes manually re-running the failed command much
easier because you can copy the whole line without ending up with the
FAILED: prefix.

8 years agoFix typo.
Nicolas Despres [Thu, 24 Sep 2015 18:02:43 +0000 (20:02 +0200)]
Fix typo.

8 years agoCleanup build on SIGHUP.
Nicolas Despres [Wed, 29 Apr 2015 07:33:37 +0000 (09:33 +0200)]
Cleanup build on SIGHUP.

SIGHUP is sent when the connection hang up (i.e. when the terminal
window is closed or the ssh connection is closed).

8 years agoMerge pull request #1014 from moroten/optimize-stringpiece
Nico Weber [Mon, 7 Sep 2015 23:52:25 +0000 (16:52 -0700)]
Merge pull request #1014 from moroten/optimize-stringpiece

Optimize StringPiece hash map

8 years agoMerge pull request #1018 from nico/spell
Nico Weber [Mon, 7 Sep 2015 21:35:21 +0000 (14:35 -0700)]
Merge pull request #1018 from nico/spell

Merge LLVM r242069, make spell checking allocate less memory.

8 years agoMerge LLVM r242069, make spell checking allocate less memory.
Nico Weber [Mon, 7 Sep 2015 21:26:19 +0000 (14:26 -0700)]
Merge LLVM r242069, make spell checking allocate less memory.

8 years agoOptimize StringPiece hash map
Fredrik Medley [Fri, 12 Jun 2015 21:59:12 +0000 (23:59 +0200)]
Optimize StringPiece hash map

Replace strncmp with memcmp to improve performance.

Signed-off-by: Fredrik Medley <fredrik.medley@gmail.com>
8 years agoDescribe why to use relative paths
Fredrik Medley [Thu, 3 Sep 2015 19:27:19 +0000 (21:27 +0200)]
Describe why to use relative paths

Ninja does resolve relative paths and file system links in paths.
Therefore, such paths pointing to the same file will not match and may
lead to an invalid dependency graph.

Signed-off-by: Fredrik Medley <fredrik.medley@gmail.com>
8 years agoMerge pull request #1009 from sgraham/fix-null.o
Nico Weber [Thu, 27 Aug 2015 06:34:48 +0000 (23:34 -0700)]
Merge pull request #1009 from sgraham/fix-null.o

Don't output null.o during configure

8 years agoDon't output null.o during configure
Scott Graham [Thu, 27 Aug 2015 02:51:15 +0000 (19:51 -0700)]
Don't output null.o during configure

8 years agoFix getopt for AIX
Mike Seplowitz [Tue, 13 Jan 2015 01:53:14 +0000 (20:53 -0500)]
Fix getopt for AIX

AIX supplies getopt but not getopt_long.

We can't use the embedded getopt implementation, since the constness of its
arguments doesn't match the AIX system routine.

8 years agoImplement GetLoadAverage on AIX using libperfstat
Mike Seplowitz [Tue, 13 Jan 2015 01:48:07 +0000 (20:48 -0500)]
Implement GetLoadAverage on AIX using libperfstat

8 years agoFix AIX compilation error related to printf macros
Mike Seplowitz [Tue, 13 Jan 2015 00:13:39 +0000 (19:13 -0500)]
Fix AIX compilation error related to printf macros

On AIX, inttypes.h gets indirectly included by build_log.h.
It's easiest just to ask for the printf format macros right away.

8 years agoStart AIX port
Mike Seplowitz [Tue, 13 Jan 2015 01:47:55 +0000 (20:47 -0500)]
Start AIX port

8 years agoStrip tabs from od's output
Mike Seplowitz [Mon, 12 Jan 2015 22:36:37 +0000 (17:36 -0500)]
Strip tabs from od's output

/bin/od on Solaris and AIX both generate tabs.

8 years agoMerge pull request #1003 from sgraham/2015-compile
Nico Weber [Mon, 10 Aug 2015 15:35:33 +0000 (08:35 -0700)]
Merge pull request #1003 from sgraham/2015-compile

Fix compile on VS2015

8 years agoRemove accidental changes
Scott Graham [Mon, 10 Aug 2015 04:27:39 +0000 (21:27 -0700)]
Remove accidental changes

8 years agoSome mucking with std:: for set_terminate and terminate_handler
Scott Graham [Mon, 10 Aug 2015 04:25:09 +0000 (21:25 -0700)]
Some mucking with std:: for set_terminate and terminate_handler

8 years agoSet _HAS_EXCEPTIONS=0 on MSVC
Scott Graham [Mon, 10 Aug 2015 04:02:23 +0000 (21:02 -0700)]
Set _HAS_EXCEPTIONS=0 on MSVC

8 years agoMerge pull request #998 from LindleyF/stdc-format-macros
Nico Weber [Mon, 3 Aug 2015 00:30:44 +0000 (17:30 -0700)]
Merge pull request #998 from LindleyF/stdc-format-macros

Make sure not to re-define __STDC_FORMAT_MACROS.

8 years agoMake sure not to re-define __STDC_FORMAT_MACROS.
Lindley French [Fri, 31 Jul 2015 00:33:11 +0000 (17:33 -0700)]
Make sure not to re-define __STDC_FORMAT_MACROS.

8 years agoPrint status when edge finishes on dumb terminals
Colin Cross [Fri, 31 Jul 2015 00:30:52 +0000 (17:30 -0700)]
Print status when edge finishes on dumb terminals

On smart terminals ninja prints the status line both before
and after running a command, reusing the same line if possible.
On a dumb terminal that doesn't support reusing the line, it
only prints the status before starting the command, but prints
the output of the command when the command finishes, by which
point other commands may have started and printed their status
line.  This makes it impossible to determine what command
produced a line of output.

Modify BuildEdgeStarted to only print the status line if the
command is going to lock the console, or if ninja is running
on a smart terminal.  Modify BuildEdgeFinished to always
print the status line unless the command locked the console,
in which case the status was already printed and no other
command can have printed any lines.

The end result will be dumb terminal output that much more
closely matches smart terminal output.  One disadvantage is
that dumb terminals won't show anything when starting a
command, making it harder to tell what commands are currently
running, but I expect most interactive uses of ninja will use
a smart terminal.

8 years agoMerge pull request #997 from mikesep/assert-arg-order
Nico Weber [Thu, 30 Jul 2015 18:21:47 +0000 (11:21 -0700)]
Merge pull request #997 from mikesep/assert-arg-order

Correct order of ASSERT_EQ arguments

8 years agoCorrect order of ASSERT_EQ arguments
Mike Seplowitz [Tue, 21 Jul 2015 22:13:26 +0000 (18:13 -0400)]
Correct order of ASSERT_EQ arguments

The correct order is ASSERT_EQ(expected, actual).

8 years agoMerge pull request #988 from nico/slashes
Nico Weber [Fri, 10 Jul 2015 19:24:23 +0000 (12:24 -0700)]
Merge pull request #988 from nico/slashes

win: print right slashes in 'unknown target' message

8 years agowin: print right slashes in 'unknown target' message
Nico Weber [Fri, 10 Jul 2015 19:15:00 +0000 (12:15 -0700)]
win: print right slashes in 'unknown target' message

8 years agoMerge pull request #973 from sgraham/canonicalize-fix
Nico Weber [Sun, 5 Jul 2015 22:53:46 +0000 (15:53 -0700)]
Merge pull request #973 from sgraham/canonicalize-fix

Fix crash in attempting to canonicalize paths longer than _MAX_PATH

8 years agoMerge pull request #979 from stinb/bootstrap-out-of-source
Nico Weber [Sun, 5 Jul 2015 22:53:28 +0000 (15:53 -0700)]
Merge pull request #979 from stinb/bootstrap-out-of-source

Bootstrap out of source

8 years agofix typos, punctuation, redundant words in HACKING.md
Nico Weber [Thu, 2 Jul 2015 00:52:16 +0000 (17:52 -0700)]
fix typos, punctuation, redundant words in HACKING.md

8 years agoMerge pull request #984 from martine/vcvars
Nico Weber [Wed, 1 Jul 2015 00:00:42 +0000 (17:00 -0700)]
Merge pull request #984 from martine/vcvars

point people at more detailed build docs if they're on Windows

8 years agopoint people at more detailed build docs if they're on Windows
Evan Martin [Tue, 30 Jun 2015 22:26:20 +0000 (15:26 -0700)]
point people at more detailed build docs if they're on Windows

It's a hard balance between "most people want to run configure --bootstrap" and
"here's a massive wall of text of every detail about building".  I think the
balance in this change is better than it was before -- most people on Windows
don't want to build their own binary.

Fixes #983.

8 years agov1.6.0 v1.6.0
Nico Weber [Mon, 29 Jun 2015 17:21:30 +0000 (10:21 -0700)]
v1.6.0

8 years agomark this 1.6.0.git
Nico Weber [Mon, 29 Jun 2015 17:16:35 +0000 (10:16 -0700)]
mark this 1.6.0.git

8 years agoFix bootstrap from a source path containing spaces.
Jason Haslam [Mon, 22 Jun 2015 22:28:04 +0000 (16:28 -0600)]
Fix bootstrap from a source path containing spaces.

8 years agoSearch for generated headers relative to build dir.
Jason Haslam [Tue, 26 May 2015 22:47:18 +0000 (16:47 -0600)]
Search for generated headers relative to build dir.

8 years agoAllow configure script to bootstrap out of source.
Jason Haslam [Tue, 26 May 2015 21:19:28 +0000 (15:19 -0600)]
Allow configure script to bootstrap out of source.

8 years agoMerge pull request #978 from martine/revert-971-bootstrap-out-of-source
Nico Weber [Mon, 22 Jun 2015 20:44:24 +0000 (13:44 -0700)]
Merge pull request #978 from martine/revert-971-bootstrap-out-of-source

Revert "Bootstrap out of source"

8 years agoRevert "Bootstrap out of source"
Nico Weber [Mon, 22 Jun 2015 20:35:37 +0000 (13:35 -0700)]
Revert "Bootstrap out of source"

8 years agoMerge pull request #975 from nico/docs
Nico Weber [Fri, 19 Jun 2015 00:34:37 +0000 (17:34 -0700)]
Merge pull request #975 from nico/docs

Document the change from #921 in the manual.

8 years agoDocument the change from #921 in the manual.
Nico Weber [Fri, 19 Jun 2015 00:22:48 +0000 (17:22 -0700)]
Document the change from #921 in the manual.

8 years agoMerge pull request #971 from stinb/bootstrap-out-of-source
Nico Weber [Thu, 18 Jun 2015 23:39:30 +0000 (16:39 -0700)]
Merge pull request #971 from stinb/bootstrap-out-of-source

Bootstrap out of source

8 years agoMerge pull request #970 from nico/explain
Nico Weber [Thu, 18 Jun 2015 23:38:48 +0000 (16:38 -0700)]
Merge pull request #970 from nico/explain

Add a missing EXPLAIN() call.

8 years agodon't alias input/output in ExtractDeps (i.e. actually works now)
Scott Graham [Thu, 18 Jun 2015 22:52:25 +0000 (15:52 -0700)]
don't alias input/output in ExtractDeps (i.e. actually works now)

8 years agopropagate include normalization failure to caller instead
Scott Graham [Thu, 18 Jun 2015 22:41:47 +0000 (15:41 -0700)]
propagate include normalization failure to caller instead

8 years agoError+exit -> Fatal
Scott Graham [Thu, 18 Jun 2015 22:06:42 +0000 (15:06 -0700)]
Error+exit -> Fatal

8 years agoMerge pull request #974 from bradking/add-missing-initializer
Nico Weber [Thu, 18 Jun 2015 21:47:41 +0000 (14:47 -0700)]
Merge pull request #974 from bradking/add-missing-initializer

Add missing member initializer in Edge constructor

8 years agoAdd missing member initializer in Edge constructor
Brad King [Tue, 16 Jun 2015 17:38:55 +0000 (13:38 -0400)]
Add missing member initializer in Edge constructor

In commit v1.1.0^2~15^2~20 (stub out an api and de-constify Pool,
2012-10-03) the Edge "pool_" member was added as a raw pointer but the
initializer was accidentally left out of the constructor.  Add it now.

8 years agodon't abort()
Scott Graham [Tue, 9 Jun 2015 17:15:11 +0000 (10:15 -0700)]
don't abort()

8 years agopush error to caller and abort on failure
Scott Graham [Tue, 9 Jun 2015 00:17:55 +0000 (17:17 -0700)]
push error to caller and abort on failure

8 years agoFix crash in attempting to canonicalize paths longer than _MAX_PATH
Scott Graham [Mon, 8 Jun 2015 20:21:55 +0000 (13:21 -0700)]
Fix crash in attempting to canonicalize paths longer than _MAX_PATH

9 years agoSearch for generated headers relative to build dir.
Jason Haslam [Tue, 26 May 2015 22:47:18 +0000 (16:47 -0600)]
Search for generated headers relative to build dir.

9 years agoAllow configure script to bootstrap out of source.
Jason Haslam [Tue, 26 May 2015 21:19:28 +0000 (15:19 -0600)]
Allow configure script to bootstrap out of source.

9 years agoAdd a missing EXPLAIN() call.
Nico Weber [Fri, 15 May 2015 00:37:50 +0000 (17:37 -0700)]
Add a missing EXPLAIN() call.

9 years agoFix typo in comment.
Nico Weber [Sat, 2 May 2015 21:38:43 +0000 (14:38 -0700)]
Fix typo in comment.

9 years agoMerge pull request #962 from sgraham/pool-use-fix
Nico Weber [Wed, 29 Apr 2015 21:26:54 +0000 (14:26 -0700)]
Merge pull request #962 from sgraham/pool-use-fix

Fix pool use count going unbalanced

9 years agoMerge pull request #743 from nicolasdespres/sigterm
Nico Weber [Mon, 27 Apr 2015 23:42:39 +0000 (16:42 -0700)]
Merge pull request #743 from nicolasdespres/sigterm

Handle SIGTERM properly.

9 years agosimplify & inline
Scott Graham [Mon, 27 Apr 2015 18:12:43 +0000 (11:12 -0700)]
simplify & inline

9 years agoavoid calling ResumeDelayedJobs instead
Scott Graham [Fri, 24 Apr 2015 23:06:55 +0000 (16:06 -0700)]
avoid calling ResumeDelayedJobs instead

9 years agoadd comment
Scott Graham [Fri, 24 Apr 2015 21:25:17 +0000 (14:25 -0700)]
add comment

9 years agoForward interruption signal to child processes.
Nicolas Despres [Wed, 16 Apr 2014 08:08:42 +0000 (10:08 +0200)]
Forward interruption signal to child processes.

9 years agoAllow SIGTERM for interruption.
Nicolas Despres [Wed, 16 Apr 2014 08:05:25 +0000 (10:05 +0200)]
Allow SIGTERM for interruption.

Default signal sent by many other programs (mainly kill(1)) to gently
terminates another one is SIGTERM.

9 years agoFix pool use count going unbalanced
Scott Graham [Thu, 23 Apr 2015 22:54:28 +0000 (15:54 -0700)]
Fix pool use count going unbalanced

9 years agoMerge pull request #958 from rui314/master
Nico Weber [Sun, 19 Apr 2015 03:43:24 +0000 (20:43 -0700)]
Merge pull request #958 from rui314/master

Run more than 34 processes on Win32 if we have 32+ cores.

9 years agoRun more than 34 processes on Win32 if we have 32+ cores.
Rui Ueyama [Fri, 17 Apr 2015 21:14:44 +0000 (14:14 -0700)]
Run more than 34 processes on Win32 if we have 32+ cores.

For compatiblity reason, dwNumberOfProcessors in Win32 is capped at 32.
So even if your machine has more than 32 cores, Ninja spawns at most 34
subprocesses. This patch fixes the issue by using GetNativeSystemInfo,
which returns the system info from Wow64 point of view, instead of
GetSystemInfo.

9 years agoMerge pull request #954 from nico/fix
Nico Weber [Thu, 9 Apr 2015 18:47:28 +0000 (11:47 -0700)]
Merge pull request #954 from nico/fix

Fix an assert (and tests in --debug mode) after #921.

9 years agoFix an assert (and tests in --debug mode) after #921.
Nico Weber [Thu, 9 Apr 2015 18:41:40 +0000 (11:41 -0700)]
Fix an assert (and tests in --debug mode) after #921.

9 years agoMerge pull request #953 from Sushisource/graphivz_fix
Nico Weber [Wed, 8 Apr 2015 19:46:19 +0000 (12:46 -0700)]
Merge pull request #953 from Sushisource/graphivz_fix

Fix backslashes in graphviz causing incorrect rendering on windows.

9 years agoFix backslashes in graphviz causing incorrect rendering on windows.
Spencer Judge [Tue, 7 Apr 2015 21:18:43 +0000 (14:18 -0700)]
Fix backslashes in graphviz causing incorrect rendering on windows.

9 years agoMerge pull request #951 from nico/cyclefix2
Nico Weber [Wed, 1 Apr 2015 21:18:39 +0000 (14:18 -0700)]
Merge pull request #951 from nico/cyclefix2

Don't get stuck on cyclic graphs where one edge has multiple outputs.

9 years agoDon't get stuck on cyclic graphs where one edge has multiple outputs.
Nico Weber [Wed, 1 Apr 2015 15:09:28 +0000 (08:09 -0700)]
Don't get stuck on cyclic graphs where one edge has multiple outputs.

Fixes #934. Plan::AddSubTarget() tracks in want_ if each edge has been
visited and visits every edge only once.  But Plan::CheckDependencyCycle()
worked on nodes however, so if a cycle was entered through an edge with
multiple outputs, ninja would fail to detect that cycle.

Move cycle detection to look for duplicate edges instead of nodes to fix
this.  The extra jump makes CheckDependencyCycle() a bit slower: for a
synthetic build file with 10000 serial build steps, `ninja -n` now takes
0.32s instead of 0.26s before on my laptop.  In practice, projects have
a dependency change length on the order of 50, so there shouldn't be a
noticeable slowdown in practice.  (If this does end up being a problem:
CheckDependencyCycle() currently does O(n) work and is called O(m) times
from AddSubTarget(), so I think cycle checking is O(n^2) in the build
depth.  So instead of worrying about constant overhead, we could use
a set<> instead of a stack<>.  But it doesn't seem to be a problem in
practice.)

9 years agoMerge pull request #950 from nico/cleanup
Nico Weber [Wed, 1 Apr 2015 15:18:49 +0000 (08:18 -0700)]
Merge pull request #950 from nico/cleanup

Simplify Plan's cycle detection code. No behavior change.

9 years agoCleanup: Don't search stack for cycle elements twice.
Nico Weber [Wed, 1 Apr 2015 15:00:27 +0000 (08:00 -0700)]
Cleanup: Don't search stack for cycle elements twice.

The common case is that there is no cycle.  In that case,
CheckDependencyCycle() searched the stack for a dupe from the back,
wouldn't find one, and return false.

If there was a cycle, it would then search again from the front
(probably because the push_back() that used to be here would invalidate
the ri iterator).

Since the push_back() is gone, just search from the front once. No
intended behavior change.

9 years agoCleanup: Make stack a const ref now that it's no longer modified.
Nico Weber [Wed, 1 Apr 2015 14:59:38 +0000 (07:59 -0700)]
Cleanup: Make stack a const ref now that it's no longer modified.

9 years agoCleanup: Don't modify during cycle checking.
Nico Weber [Wed, 1 Apr 2015 14:56:14 +0000 (07:56 -0700)]
Cleanup: Don't modify  during cycle checking.