[polly] r309856 - Replace asserts with llvm_unreachable to clarify intent

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 7 13:12:36 PDT 2017


Yeah, would be nice if a warning caught this. (currently looks like only
-Wstring-conversion catches this, which isn't much use (would catch a whole
bunch of other less useful things))
+rtrieu in case this is of interest to him.


On Mon, Aug 7, 2017 at 11:51 AM Tobias Grosser <tobias at grosser.es> wrote:

> Good point. I saw that as well, but should have mentioned it in the
> commit message. I wonder why there is no warning for this.
>
> Best Tobias
>
> On Mon, Aug 7, 2017, at 20:46, David Blaikie via llvm-commits wrote:
> > Nice! (also those asserts didn't work - string literal is always true
> > (always a non-null pointer) :) )
> >
> > On Wed, Aug 2, 2017 at 12:12 PM Tobias Grosser via llvm-commits <
> > llvm-commits at lists.llvm.org> wrote:
> >
> > > Author: grosser
> > > Date: Wed Aug  2 12:11:46 2017
> > > New Revision: 309856
> > >
> > > URL: http://llvm.org/viewvc/llvm-project?rev=309856&view=rev
> > > Log:
> > > Replace asserts with llvm_unreachable to clarify intent
> > >
> > > Modified:
> > >     polly/trunk/lib/Support/RegisterPasses.cpp
> > >
> > > Modified: polly/trunk/lib/Support/RegisterPasses.cpp
> > > URL:
> > >
> http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Support/RegisterPasses.cpp?rev=309856&r1=309855&r2=309856&view=diff
> > >
> > >
> ==============================================================================
> > > --- polly/trunk/lib/Support/RegisterPasses.cpp (original)
> > > +++ polly/trunk/lib/Support/RegisterPasses.cpp Wed Aug  2 12:11:46 2017
> > > @@ -464,7 +464,7 @@ static void buildDefaultPollyPipeline(Fu
> > >      case OPTIMIZER_NONE:
> > >        break; /* Do nothing */
> > >      case OPTIMIZER_ISL:
> > > -      assert("ISL optimizer is not implemented");
> > > +      llvm_unreachable("ISL optimizer is not implemented");
> > >        break;
> > >      }
> > >
> > > @@ -482,7 +482,7 @@ static void buildDefaultPollyPipeline(Fu
> > >    }
> > >  #ifdef GPU_CODEGEN
> > >    else
> > > -    assert("Hybrid Target with GPU support is not implemented");
> > > +    llvm_unreachable("Hybrid Target with GPU support is not
> implemented");
> > >  #endif
> > >
> > >    PM.addPass(CodePreparationPass());
> > >
> > >
> > > _______________________________________________
> > > llvm-commits mailing list
> > > llvm-commits at lists.llvm.org
> > > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
> > >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170807/8466c88c/attachment.html>


More information about the llvm-commits mailing list