<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Dear Vanderson,<br>
<br>
You need to write a MachineFunctionPass instead of a ModulePass or
FunctionPass. A MachineFunctionPass is given a MachineFunction to
analyze/transform in its runOnFunction() method.<br>
<br>
MachineFunctionPass'es are run by llc and other LLVM-based tools
that generate native code (such as the libLTO plugin and Clang).<br>
<br>
Regards,<br>
<br>
John Criswell<br>
<br>
On 10/14/14, 4:52 PM, Vanderson Martins do Rosario wrote:<br>
</div>
<blockquote
cite="mid:CAMzYVD0WvUpNXamNeAfyUCWn6JFs7isLMZgt23OnAX2T_JrLiA@mail.gmail.com"
type="cite">
<div dir="ltr">Hi everybody,<br>
<br>
I know that this may be a very silly question, but seriously,
I'm totally lost.<br>
<br>
So, what I want to know is how from my Module I can get
MachineFunctions or MachineBasicBlocks.<br>
<br>
I'm able to read a file with LLVM IR, create the Module and I
also managed to create some passes for it, but what I want is to
see the x86-64 assembly that this IR generates and map
MachineBasicBlocks with BasicBlocks.<br>
<br>
I know that I should follow the Instruction Selection steps from
<a moz-do-not-send="true"
href="http://llvm.org/docs/CodeGenerator.html#using-the-machineinstrbuilder-h-functions">http://llvm.org/docs/CodeGenerator.html#using-the-machineinstrbuilder-h-functions</a>,
but I couldn't figure it out how to do this. I also tried to
read the llc's code, but it didn't help me so much.<br>
<br>
I would be grateful if somebody show me an example of how from a
Module I can get MachineBasicBlocks.<br>
<br>
Thank you,<br>
<br clear="all">
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div dir="ltr"><span
style="color:rgb(102,102,102)">Vanderson M.
Rosario</span><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a class="moz-txt-link-freetext" href="http://www.cs.rochester.edu/u/criswell">http://www.cs.rochester.edu/u/criswell</a></pre>
</body>
</html>