<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
<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 (http://llvm.org/docs/LangRef.html#named-metadata) :<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>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 (http://llvm.org/docs/LangRef.html#metadata-nodes-and-metadata-strings) there is written:</span></div><div><br></div><div><p style="margin-top: 0.8em; margin-bottom: 0.5em; line-height: 21px; background-color: rgb(255, 255, 255);"><font size="2">Metadata can be used as function arguments. Here <tt class="docutils literal">llvm.dbg.value</tt> function is using two metadata arguments:</font></p><div class="highlight-llvm" style="line-height: 21px; background-color: rgb(255, 255, 255);"><div class="highlight" 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" size="2"><span class="k" style="color: rgb(0, 112, 32); font-weight: bold;">call</span> <span class="kt" style="color: rgb(144, 32, 0);">void</span> <span class="vg" style="color: rgb(187, 96, 213);">@llvm.dbg.value</span><span class="p">(</span><span class="kt" style="color: rgb(144, 32, 0);">metadata</span> <span class="nv-Anonymous">!24</span><span class="p">,</span> <span class="k" style="color: rgb(0, 112, 32); font-weight: bold;">i64</span> <span class="m" style="color: rgb(64, 160, 112);">0</span><span class="p">,</span> <span class="kt" style="color: rgb(144, 32, 0);">metadata</span> <span class="nv-Anonymous">!25</span><span class="p">)</span></font></pre></div></div></div><div><br></div><div><p style="margin-top: 0.8em; margin-bottom: 0.5em; line-height: 21px; background-color: rgb(255, 255, 255);"><font size="2">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="margin-top: 0.8em; margin-bottom: 0.5em; line-height: 21px; background-color: rgb(255, 255, 255);"><font size="2">Thank you :)</font></p><p style="margin-top: 0.8em; margin-bottom: 0.5em; line-height: 21px; background-color: rgb(255, 255, 255);"><font size="2"><br></font></p><p style="margin-top: 0.8em; margin-bottom: 0.5em; line-height: 21px; background-color: rgb(255, 255, 255);"><font size="2">Niko</font></p></div> </div></body>
</html>