[patch][rfc] Asserting that we have all use/users in the getters
Teresa Johnson via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 18 06:17:04 PST 2015
Also got bit by this once, so really like the idea.
Some clear comments are needed to explain what "unchecked" means and
when you would want to use it, since it isn't obvious from the name. I
can't think of any alternate name that is particularly meaningful and
reasonably concise. Maybe "materialized_uses", etc to indicate it is
only looking for uses that have been materialized thus far?
Thanks,
Teresa
On Fri, Dec 18, 2015 at 1:03 AM, Mehdi Amini via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
>
>> 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>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
--
Teresa Johnson | Software Engineer | tejohnson at google.com | 408-460-2413
More information about the llvm-commits
mailing list