[llvm-dev] function parameter attribute issue

Julien Schmitt via llvm-dev llvm-dev at lists.llvm.org
Tue Jan 19 02:39:37 PST 2016


Hi all,
i'm trying to write a module pass.

I'm compiling a class with a method having const reference parameter 
('void myclass::fn(const struct &r)'  )
When I print the IR output,  the definition of this function has 
parameter attributes  'nocapture' 'readonly' 'dereferenceable'
which is expected. But when calling this method in a main, the attribute 
'nocapture' and 'readonly' have disapeared and replaced by 'nonnull';  
This is confirmed by the method doesNotCapture of the CallSite which 
return false.
Can anybody explain me why we can not see the original attributes ?
Thank you

Julien



More information about the llvm-dev mailing list