<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'>
Hi, I am trying to write a Pass that reads metadata passed as a argument to a function.<div><br></div><div>I have written them by hand in the .s file in the same way of the IR reference (http://llvm.org/docs/LangRef.html#named-metadata) :</div><div><br></div><div><div>define i32 @function(i32 %argInt, metadata !3) nounwind {</div><div>entry:</div><div> %argInt.addr = alloca i32, align 4</div><div> store i32 %argInt, i32* %argInt.addr, align 4</div><div> %1 = load i32* %argInt.addr, align 4</div><div> %add = add nsw i32 %1, 1</div><div> ret i32 %add</div><div>}</div><div><br></div><div>!3 = metadata !{metadata !"metadata text"}</div><div><br></div><div>but when I run my pass with opt on the .s file I get this error:</div><div><br></div><div>
<p class="p1">29:44: error: expected ')' at end of argument list</p>
<p class="p1">define i32 @function(i32 %argInt, metadata !3) nounwind {</p><p class="p1"><br></p><p class="p1">How should I write a metadata in order to be able to get it from a function?</p><p class="p1">There's eventually another way to attach a metadata to a function?</p><p class="p1"><br></p><p class="p1">Thank you in advance, </p><p class="p1"><br></p><p class="p1">Niko</p></div><div><br></div><div><br></div><div><br></div></div> </div></body>
</html>