[patch] Don't make assumptions about the name of private global variables

Michael Gottesman mgottesman at apple.com
Tue Nov 11 12:21:45 PST 2014


The simplest and least fragile way to test this is to make a small pass like the AAEvaluator that just runs ProvenanceAnalysis::related on all values in the function and just prints out a bool value. Then you could just use FileCheck to check that the query was successful.

The other way is to try and create a specific sequence of instructions that hopefully will show by how the ARC optimizer moves a release that the query is correct.

That is more fragile and probably harder to suss out exactly.

If you want to do the latter I think I can come up with a sequence, but really the former is the *right* thing to do.

Michael

> On Nov 10, 2014, at 7:05 PM, Duncan P. N. Exon Smith <dexonsmith at apple.com> wrote:
> 
> +mgottesman: any idea how to test this?
> 
>> On 2014-Nov-10, at 14:08, Rafael EspĂ­ndola <rafael.espindola at gmail.com <mailto:rafael.espindola at gmail.com>> wrote:
>> 
>> Private variables are can be renamed, so it is not reliable to make
>> decisions on the name.
>> 
>> The name is also dropped by the assembler before getting to the
>> linker, so using the name causes a disconnect between how llvm makes a
>> decision (var name) and how the linker makes a decision (section it is
>> in).
>> 
>> The attached patch changes one case where we were looking at the
>> variable name to use the section instead.
>> 
>> I don't know what this arc pass is doing, so I am not sure how to test it.
>> 
>> Cheers,
>> Rafael
>> <t.patch>_______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu <mailto:llvm-commits at cs.uiuc.edu>
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits <http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141111/f0160030/attachment.html>


More information about the llvm-commits mailing list