<div dir="ltr">Yes, this is for a front-end-ish project. I generate LLVM IR from assembly. The result is optimized through several builtin passes, like simplify cfg, value propagation, simple const propagation, etc. I tried setDebugLoc, but it gets dropped. Aside from simplify CFG, I can't see where this happens, and it is already dropped before simplify cfg. It looks like I would be better off adding instruction metadata after generating IR, outside LLVM, instead of forcing it to process things backwards.<br></div><br><div class="gmail_quote"><div dir="ltr">Adrian Prantl <<a href="mailto:aprantl@apple.com">aprantl@apple.com</a>> ezt írta (időpont: 2019. jan. 14., H, 17:26):<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Generally, a good strategy is to look at what Clang generates for similar code and mimic that in your IR generator.<br>
<br>
-- adrian<br>
</blockquote></div>