Hi! I have code with dead function calls which are not removed. Is it possible to mark functions that have no side effects (e.g. sin() or floor() ) so that they are removed by dead code elimination? -Jochen
On Jul 25, 2010, at 6:48 AM, Jochen Wilhelmy wrote:> Hi! > > I have code with dead function calls which are not removed. Is it possible > to mark functions that have no side effects (e.g. sin() or floor() ) so > that they > are removed by dead code elimination?Yep, just add the readonly/readnone attributes to the call site or function and they should be deleted if dead. See LangRef.html for more info. -Chris
> Yep, just add the readonly/readnone attributes to the call site or function and they should be deleted if dead. See LangRef.html for more info. > >Is it even possible to define this attribute in clang? e.g. __attribute__(readnone) float sin(float x); -Jochen