[PATCH] D29011: [IR] Add Freeze instruction

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 24 16:10:18 PST 2017


On Tue, Jan 24, 2017 at 11:00 AM, Filipe Cabecinhas <
filcab+llvm.phabricator at gmail.com> wrote:

> True. What's the usual test harness to make sure the verifier aborts,
> though?
> If both the binary and the text parsers assert before generating IR,
> and you're adding the instruction, so there's no other thing that
> generates one, how do you test that assert? Or do we just let them be
> and hope we don't end up out of sync? :-)
>

You'd test the assert by constructing some IR from the C++ interface (using
a unit test or something similar) and then run the verifier.


>
> Thank you,
>  Filipe
>
> On Tue, Jan 24, 2017 at 6:41 PM, David Majnemer via Phabricator via
> llvm-commits <llvm-commits at lists.llvm.org> wrote:
> > majnemer added inline comments.
> >
> >
> > ================
> > Comment at: lib/AsmParser/LLParser.cpp:5914
> > +  if (!Op->getType()->isIntegerTy())
> > +    return Error(Loc, "cannot freeze non-integer type");
> > +
> > ----------------
> > filcab wrote:
> >> filcab wrote:
> >> > Please test this error.
> >> Even better: Should this be in the verifier only? Otherwise you're
> checking for the same thing in two places, which is easy to get out of
> sync. (Would still require a test)
> > its not bad for them to be in both, the error messages are much nicer in
> the parser.
> >
> >
> > https://reviews.llvm.org/D29011
> >
> >
> >
> > _______________________________________________
> > 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/20170124/3813199b/attachment.html>


More information about the llvm-commits mailing list