[cfe-commits] patch: add __attribute__((halting))
Douglas Gregor
dgregor at apple.com
Tue Jul 6 11:46:46 PDT 2010
On Jul 5, 2010, at 11:55 PM, Nick Lewycky wrote:
> This patch adds support for an attribute used to indicate that the function in question will not loop indefinitely. This is a counter-part to the LLVM patch http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20100705/103672.html which must be applied first.
>
> The idea is that we can't currently delete the dead code:
> void foo(set<int> *s) { s->find(10); }
> because the compiler is afraid that set<>::find may have the side-effect of infinite looping. With a halting attribute manually applied in key places, such as the declaration of find(), we can unstick dead code elimination and ultimately reduce code size.
>
> Please review!
The patch looks good, although you're missing PCH (de-)serialization code for the new attribute.
- Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20100706/8b4b1dff/attachment.html>
More information about the cfe-commits
mailing list