<div dir="ltr"><div dir="ltr">Llvm-mctoll will raise a binary back to LLVM IR. <div>Not exactly what you want but it might be something you can leverage.</div><div><br></div><div><a href="https://github.com/microsoft/llvm-mctoll">https://github.com/microsoft/llvm-mctoll</a> </div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Nov 25, 2019 at 1:19 PM Nicolai Hähnle via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">On Thu, Nov 21, 2019 at 3:37 AM Lele Ma via llvm-dev<br>
<<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
> My goal is to write LLVM Machine IR (MIR) passes to analyze the assembly source code. But it seems I need to find a way to translate the handwritten assembly code into MIR format first.<br>
><br>
> Is there any materials, or any modules in LLVM source code, that can help to translate assembly code into LLVM MIR for analysis?<br>
><br>
> Or is there any easier ways to analyze assembly code in MIR passes without translating it?<br>
<br>
MachineIR is designed for code generation, not for general assembly<br>
representation. MIR is even not necessarily able to represent all<br>
assembly instructions that a target's hardware supports. The<br>
disassembler produces MCInsts, and if you wanted to go from there back<br>
to MachineIR, you'd have to write your own target-specific code to do<br>
so.<br>
<br>
Cheers,<br>
Nicolai<br>
<br>
<br>
<br>
><br>
> Best Regards,<br>
> Lele Ma<br>
><br>
><br>
> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br>
<br>
<br>
-- <br>
Lerne, wie die Welt wirklich ist,<br>
aber vergiss niemals, wie sie sein sollte.<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>