[PATCH] D16514: Add -stop-on-failure driver option, and enable it by default for CUDA compiles.

Justin Lebar via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 28 14:37:23 PST 2016


jlebar added inline comments.

================
Comment at: lib/Driver/Driver.cpp:652
@@ -640,3 +651,3 @@
   SmallVector<std::pair<int, const Command *>, 4> FailingCommands;
-  C.ExecuteJobs(C.getJobs(), FailingCommands);
+  C.ExecuteJobs(C.getJobs(), /* StopOnFailure = */ false, FailingCommands);
 
----------------
tra wrote:
> jlebar wrote:
> > tra wrote:
> > > As far as I can tell, we don't do anything interesting if we've detected that *any* of the commands have failed. That suggests that doing anything beyond the first failing command does not do us any good. That would suggest that we may really want StopOnFailure=true here.
> > > 
> > > 'false' would preserve current behavior, though.
> > > 
> > > In either case I'm OK with a constant here.
> > Sorry, I think I'm misunderstanding something.  Would you mind rephrasing this?
> > 
> > > As far as I can tell, we don't do anything interesting if we've detected that *any* of the commands have failed.  That suggests that doing anything beyond the first failing command does not do us any good.
> > 
> > The scenario I thought this change applied to was:
> > 
> > External tool crashes during a call to ExecuteJobs() (not this one).  We now want to output preprocessed inputs, so we run this code, which again calls ExecuteJobs(), but these jobs only run the preprocessor on the inputs.
> > 
> > Now suppose one of those preprocessor jobs fails.  Maybe it has a bad preprocessor directive, or maybe #error would be enough.  It seems to me in this case that we should continue running the other preprocessor jobs, so we dump as much debug info as we can.
> > 
> > Note that if the StopOnFailure flag is false, afaict it's entirely possible for us to have two inputs, one of which has a pp error and the other of which causes a compiler crash -- if we stopped on failure here, we wouldn't output anything for the second input, which is the one we're interested in.
> > 
> > Sorry again, I'm sure I'm missing something.
> Look at the lines below. If there are any failing commands we just report an error and return.
> Even if there are multiple preprocessor jobs and if some of them succeed, we would not get to use their output.
> 
Oh.

Thanks.  :)


http://reviews.llvm.org/D16514





More information about the cfe-commits mailing list