<div dir="ltr"><div>We have no idea at initialization time if the user wants to target win32 or the host, so we couldn't conditionalize it if we wanted to.</div><div><br></div><div>We initialize the pass so that we can run it from opt and test it in isolation. It's consistent what NVPTX does in llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp. We just copied the technique.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 1, 2015 at 6:35 AM, Vladislav <span dir="ltr"><<a href="mailto:vlad@ispras.ru" target="_blank">vlad@ispras.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">ivladak added a subscriber: ivladak.<br>
ivladak added a comment.<br>
<br>
Could you please explain why you<br>
<br>
  initializeWinEHStatePassPass(PR);<br>
<br>
in `LLVMInitializeX86Target()` regardless of whether the target is win32 or not?<br>
<br>
Sorry if the question is silly. I actually have NFC about what's going on in this commit.<br>
<br>
I am getting some nasty memory corruption problems which might or might not be caused by this unconditional initialization.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="http://reviews.llvm.org/D12098" rel="noreferrer" target="_blank">http://reviews.llvm.org/D12098</a><br>
<br>
<br>
<br>
</div></div></blockquote></div><br></div>