http://llvm.org/bugs/show_bug.cgi?id=9022
Summary: How to set call attributes via C binding?
Product: Documentation
Version: 2.8
Platform: Other
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: General docs
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Created an attachment (id=6031)
--> (http://llvm.org/bugs/attachment.cgi?id=6031)
attempt to set ReadNone attribute at call
I wonder how to set an attribute like readnone to a call.
Attached is a C program where I try to do add the readnone attribute using
LLVMAddInstrAttribute, which seems to be wrong, since this adds the attribute
to the result of the call. The verifier pass thus complains:
Attribute readnone only applies to the function!
%2 = call readnone double @llvm.exp.f64(double %0)
Attribute readnone only applies to the function!
%3 = call readnone double @llvm.sin.f64(double %1)
Broken module found, compilation aborted!
Stack dump:
0. Running pass 'Function Pass Manager' on module '_module'.
1. Running pass 'Module Verifier' on function '@arithmetic'
Aborted
I also tried LLVMAddAttribute (but as far as I understand this is for
parameters of the surrounding function) and LLVMAddFunctionAttr (but I want to
add to a call, not a function). Both do not work.
How can I add an attribute to a call? Or is this not necessary at all?
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs