[patch][rfc] Asserting that we have all use/users in the getters

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 18 01:03:06 PST 2015


> On Dec 15, 2015, at 2:02 PM, Rafael EspĂ­ndola <rafael.espindola at gmail.com> wrote:
> 
> An error that is pretty easy to make is to use the lazy bitcode reader
> and then do something like
> 
> if (V.use_empty())
> 
> The problem is that uses in unmaterialized functions are not accounted for.
> 
> The attached patch adds asserts that all uses are known. I think it
> can be reduced a bit by dropping support for dematerializing, which
> seems dead. I will send a patch for that, but I just wanted to ask if
> this looks like a good idea.

I was bitten by that, I think it is a good idea to check for it.

Thanks!

Mehdi


> 
> Cheers,
> Rafael
> <t.diff>



More information about the llvm-commits mailing list