<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 Sachin,<br>
<br>
You will want to read up on the LLVM Code Generator
infrastructure:
<a class="moz-txt-link-freetext" href="http://llvm.org/docs/CodeGenerator.html#machine-code-description-classes">http://llvm.org/docs/CodeGenerator.html#machine-code-description-classes</a><br>
<br>
Also, a MachineFunctionPass is nearly the same as an LLVM
FunctionPass except that it operations on MachineFunction objects
instead of Function objects. If you read the "Writing an LLVM
Pass" document (<a class="moz-txt-link-freetext" href="http://llvm.org/docs/WritingAnLLVMPass.html">http://llvm.org/docs/WritingAnLLVMPass.html</a>) and
understand how to use MachineInstr's, MachineBasicBlocks, and
MachineInstr's, you should be able to figure it out.<br>
<br>
Finally, take a look at the doxygen documentation anytime you need
details on how to use a specific LLVM class, and as David
suggested, take a look at existing code.<br>
<br>
Regards,<br>
<br>
John Criswell<br>
<br>
<br>
On 9/17/14, 4:44 PM, sachin arora wrote:<br>
</div>
<blockquote
cite="mid:CAJXV4b=d6zaoQhZFRM8RG5UVJFRE_eEvcHXD7e+Y2ARfAQfZXw@mail.gmail.com"
type="cite">
<div dir="ltr">Hello all,
<div><br>
</div>
<div>I need to modify llvm bytecode / native code just before it
is emitted i.e. after all the regular operations and
optimizations are done. I was told that this can be achieved
by implementing a MachineFunctionPass. </div>
<div>I searched the internet for some tutorials or some example
MachineFunctionPass but found nothing. Kindly point some
links, or anything that may help. Thank you.</div>
<div><br>
</div>
<div>Regards,</div>
<div>Sachin</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>
</body>
</html>