<div dir="ltr"><div>i want to use the external LLVM pass that built in out-of-source on windows.</div><div>and, my sample pass just dump the llvm::Module during compiling some source code.</div><div><br></div><div>i use this command.</div><span class="im"><div>opt.exe -load -Xclang mypass.dll -mypass test.bc -o optimized_test.bc</div><div><br></div></span><div>so, as my expect, </div><div>my pass should dump the llvm::Module of 'test.bc',</div><div>but, i couldn't see anything in my console.</div><div><br></div><div>one the other hand, i can see the result of dump() on Linux with same source code (testpass.cpp)</div><div><br></div><div>Thanks,</div><div>Seok Hong</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-07-22 22:10 GMT+09:00 mats petersson <span dir="ltr"><<a href="mailto:mats@planetcatfish.com" target="_blank">mats@planetcatfish.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>It would probably help if you explained what happens and how that is different from what you expect... <br><br>--<br></div>Mats<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On 22 July 2015 at 13:17, Hong Seok <span dir="ltr"><<a href="mailto:seok85.hong@gmail.com" target="_blank">seok85.hong@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div><div class="h5"><div dir="ltr"><p>Hello all,</p><p>Still, is it impossible to use the external llvm custom pass on windows?</p><p>I can build the 'mypass.dll' on windows using LLVM libraries. And, I use these 2 way to use my pass.<br>clang.exe -Xclang -load -Xclang mypass.dll -c test.c<br>opt.exe -load -Xclang mypass.dll -mypass test.bc -o optimized_test.bc</p><p><br>But, Clang and opt didn't working well with my pass.</p><p><br>This mean, my pass can dump the llvm::Module in compilation time. and my pass can dump that on Linux. but, my pass didn't print anything on Windows.</p><p>Additionally, i already built the LLVM and Clang on Windows using CMake.</p><p>To avoid confusing, i'm writing my source code.</p><p>#include <iostream><br>using namespace std;</p><p>#include <llvm/Pass.h><br>#include <llvm/IR/Module.h><br>using namespace llvm;</p><p>class SampleIRModule : public llvm::ModulePass {<br>  public:<br>    static char ID;<br>    SampleIRModule() : llvm::ModulePass(ID) {}</p><p>    bool runOnModule(llvm::Module &M);<br>};</p><p>bool SampleIRModule::runOnModule(llvm::Module &M) {<br>    M.dump();<br>    return false;<br>}</p><p>char SampleIRModule::ID = 0;<br>static RegisterPass<SampleIRModule> X("SampleIRModule", "SampleIRModule Pass");</p><p><br>And,here is my build command on windows.<br>cl /EHsc -ID:\LLVM\llvm-3.4.2\build_nmake\output/include    -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -wd4146 -wd4180 -wd4244 -wd4267 -wd4345 -wd4351 -wd4355 -wd4503 -wd4624 -wd4800 -wd4291 -w14062 -we4238 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -c testpass.cpp</p><p>cl /D_USRDLL /D_WINDLL testpass.obj /link /DLL /OUT:testpass.dll D:\LLVM\llvm-3.4.2\build_nmake\output\lib\LLVMCore.lib ... (including other LLVM libraries)</p><p>Thanks,<br>Seok Hong</p></div>
<br></div></div>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank" rel="noreferrer">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank" rel="noreferrer">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>