[Lldb-commits] [lldb] r190069 - OptionValueProperties::DeepCopy (): return empty value to avoid compilation error on MSVC (even if assert).
Virgile Bello
virgile.bello at gmail.com
Thu Sep 5 19:15:54 PDT 2013
Problem is not runtime but compile time. In MSVC, such a code doesn't
compile:
int test() { assert(false); }
error C4716: 'test' : must return a value
So from what I understood of llvm_unreachable, it woulnd't help either
since it's just a replacement of assert that also doesn't return anything.
On Fri, Sep 6, 2013 at 5:08 AM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
> On Thu, Sep 5, 2013 at 9:57 AM, Virgile Bello <virgile.bello at gmail.com>
> wrote:
> > Author: xen2
> > Date: Thu Sep 5 11:57:48 2013
> > New Revision: 190069
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=190069&view=rev
> > Log:
> > OptionValueProperties::DeepCopy (): return empty value to avoid
> compilation error on MSVC (even if assert).
> >
> > Modified:
> > lldb/trunk/source/Interpreter/OptionValueProperties.cpp
> >
> > Modified: lldb/trunk/source/Interpreter/OptionValueProperties.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueProperties.cpp?rev=190069&r1=190068&r2=190069&view=diff
> >
> ==============================================================================
> > --- lldb/trunk/source/Interpreter/OptionValueProperties.cpp (original)
> > +++ lldb/trunk/source/Interpreter/OptionValueProperties.cpp Thu Sep 5
> 11:57:48 2013
> > @@ -651,6 +651,7 @@ lldb::OptionValueSP
> > OptionValueProperties::DeepCopy () const
> > {
> > assert(!"this shouldn't happen");
> > + return lldb::OptionValueSP();
> > }
>
> llvm_unreachable?
>
> Dmitri
>
> --
> main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
> (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20130906/65911b5e/attachment.html>
More information about the lldb-commits
mailing list