<div dir="ltr">That's metadata for arguments to calling a function, you tried to attach metadata to the arguments of a declaration of a function.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On 11 February 2013 22:58, Niko Zarzani <span dir="ltr"><<a href="mailto:koni10@hotmail.it" target="_blank">koni10@hotmail.it</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div><div dir="ltr"><div class="im">
<span style="font-size:10pt">> > I have written them by hand in the .s file in the same way of the IR</span><br><div>> > reference (<a href="http://llvm.org/docs/LangRef.html#named-metadata" target="_blank">http://llvm.org/docs/LangRef.html#named-metadata</a>) :<br>
> ><br>> > define i32 @function(i32 %argInt, metadata !3) nounwind {<br>> <br>> This seems wrong. "metadata" is a type (like i32), and the exclamation<br>> mark is only used to refer to metadata nodes, not to declare functions<br>
> with them.<br><br></div></div><div>I'm only interested in attaching a metadata string to a function with wirtten its precondition...Since h<span style="font-size:10pt">ere in the IR reference (<a href="http://llvm.org/docs/LangRef.html#metadata-nodes-and-metadata-strings" target="_blank">http://llvm.org/docs/LangRef.html#metadata-nodes-and-metadata-strings</a>) there is written:</span></div>
<div><br></div><div><p style="line-height:21px;margin-bottom:0.5em;margin-top:0.8em"><font>Metadata can be used as function arguments. Here <tt>llvm.dbg.value</tt> function is using two metadata arguments:</font></p><div style="line-height:21px">
<div style="background-color:rgb(240,240,240)"><pre style="overflow-x:auto;overflow-y:hidden;line-height:15px;padding:0.5em;border:1px solid rgb(204,204,204);background-color:rgb(248,248,248)"><font face="Tahoma"><span style="color:rgb(0,112,32);font-weight:bold">call</span> <span style="color:rgb(144,32,0)">void</span> <span style="color:rgb(187,96,213)">@llvm.dbg.value</span><span>(</span><span style="color:rgb(144,32,0)">metadata</span> <span>!24</span><span>,</span> <span style="color:rgb(0,112,32);font-weight:bold">i64</span> <span style="color:rgb(64,160,112)">0</span><span>,</span> <span style="color:rgb(144,32,0)">metadata</span> <span>!25</span><span>)</span></font></pre>
</div></div></div><div><br></div><div><p style="line-height:21px;margin-bottom:0.5em;margin-top:0.8em"><font>I thought that maybe writing them as a function argument and then reading them could work... there is any other way to do that?</font></p>
<p style="line-height:21px;margin-bottom:0.5em;margin-top:0.8em"><font>Thank you :)</font></p><span class="HOEnZb"><font color="#888888"><p style="line-height:21px;margin-bottom:0.5em;margin-top:0.8em"><font><br></font></p>
<p style="line-height:21px;margin-bottom:0.5em;margin-top:0.8em"><font>Niko</font></p></font></span></div>                                    </div></div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div>