[LLVMdev] [RFC] New function attributes for errno-setting functions

Krzysztof Parzyszek kparzysz at codeaurora.org
Fri Sep 13 11:52:36 PDT 2013

On 9/12/2013 7:44 PM, Hal Finkel wrote:
> To fix this problem, I think that we need to stop treating errno as some arbitrary external state, and model is explicitly.

In such case it would make sense to know when "errno" is read.  This way 
we could detect whether it's actually used, whether or not the 
-fno-math-errno (or some generic -fno-xyz-errno) was specified.  Problem 
is that errno (referenced explicitly) may be a macro that expands to 
some system-specific function call.

On that note, what would be really nice is if a function could have an 
"mod/use" sets attached to it, which would specify what external symbols 
this function can reference.  I'm not sure how that could be expressed 
in the current IR though.


Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, 
hosted by The Linux Foundation

More information about the llvm-dev mailing list