On 12/01/2011 04:52 PM, David Malcolm wrote:
As for detecting where the result gets compared against 0, I'm
not sure
of the best way to do this. Perhaps you could run your pass after the
code is in SSA form, and then identify exactly which variables hold
result values from a getLength() call, and then look for comparisons
with them against 0. Am not sure how copy-propagation works yet, so
this is just a suggestion.
I got a script working now that runs after cfg and finds a decent number
of occurrences of what I wanted it to find, and not too many false
positives. The script is at
<
https://bugs.freedesktop.org/attachment.cgi?id=54059>, if anyone's
interested (belonging to a LibreOffice cleanup bug at
<
https://bugs.freedesktop.org/show_bug.cgi?id=43460>).
Thanks a lot again,
Stephan