[LLVMdev] DCE and external function

leledumbo leledumbo_cool at yahoo.co.id
Wed Oct 13 02:39:04 PDT 2010


> No of course not. Nobody ever checks the return value of printf, for
> example. :)
> 
> The only special case is if you name your function something that exists
> in the C standard library; if you name your function "malloc" we're
> going to remove calls to it with unused results.

OK, sounds I'm on the right way :)

> At the level of the original C source you can do this using gcc's "pure"
> and
> "const" attributes.  At the level of LLVM IR, you can use the "readonly"
> and
> "readnone" attributes.

This makes things clearer.

Thanks to all.

-- 
View this message in context: http://old.nabble.com/DCE-and-external-function-tp29932485p29951053.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.




More information about the llvm-dev mailing list