[PATCH] D15272: [Verifier] Verifier that a GlobalValue is only used in this Module

Keno Fischer via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 24 06:38:45 PST 2015


Say you use a global in a function in some other module. If I understand
your patch correctly it would recursively complain about all the
instructions which have some use relation to the one that uses the bad
global as opposed to just the first one.

On Thu, Dec 24, 2015 at 2:57 PM, Rafael EspĂ­ndola <
rafael.espindola at gmail.com> wrote:

> I am not sure I follow. Can you provide an example where the patch I
> send produces a bad error message?
>
> On 24 December 2015 at 01:39, Keno Fischer <kfischer at college.harvard.edu>
> wrote:
> > I'm concerned that that does too much work, because the Function and in
> the
> > Instruction will be checked again elsewhere. Also, the error message
> would
> > be bad, since the problem of which value is used outside the module is
> > actually somewhere else.
> >
> > On Wed, Dec 23, 2015 at 8:33 PM, Rafael EspĂ­ndola
> > <rafael.espindola at gmail.com> wrote:
> >>
> >> On 23 December 2015 at 13:18, Keno Fischer <
> kfischer at college.harvard.edu>
> >> wrote:
> >> > Somewhere we have to have the logic as to which users we can handle
> >> > (those
> >> > which are embedded in a module). We can have that in the callback
> with a
> >> > boolean flag as to whether we could handle it, or we could have that
> >> > logic
> >> > in the foreach function. The latter seemed cleaner to me, but as I
> said,
> >> > no
> >> > strong opinions here.
> >> >
> >>
> >> What I am suggesting is that the helper should be a fully generic
> >> "walk every user". What do you think of the attached patch?
> >>
> >>
> >> Cheers,
> >> Rafael
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151224/7330e3de/attachment.html>


More information about the llvm-commits mailing list