Hello LLVM Folks,
<div><br></div><div>I just tried running the example off <a href="http://llvm.org/docs/WritingAnLLVMPass.html#quickstart">http://llvm.org/docs/WritingAnLLVMPass.html#quickstart</a>. I used the same code in the example to create a new pass called hello, and tried compiling the same like: </div>

<div><br></div><div>The code for pass.cpp: </div><div><div><br></div><div>#include "llvm/Pass.h"</div><div>#include "llvm/Function.h"</div><div>#include "llvm/Support/raw_ostream.h"</div><div>

<br></div><div>using namespace llvm;</div><div><br></div><div>namespace {</div><div>  struct Hello : public FunctionPass {</div><div><br></div><div>    static char ID;</div><div>    Hello() : FunctionPass(ID) {}</div><div>

<br></div><div>    virtual bool runOnFunction(Function &F) {</div><div>      errs() << "Hello: ";</div><div>      errs().write_escaped(F.getName()) << '\n';</div><div>      return false;</div>

<div>    }</div><div><br></div><div>  };</div><div>}</div><div><br></div><div>char Hello::ID = 0;</div><div>static RegisterPass<Hello> X("hello", "Hello World Pass", false, false);</div></div><div>

<br></div><div>Compile Steps: </div><div>g++ -c pass.cpp -I/usr/local/include `llvm-config --cxxflags`</div><div>g++ -shared -o pass.so pass.o -L/usr/local/lib `llvm-config --ldflags --libs`</div><div><br></div><div>Followed by: </div>

<div>opt -load=pass.so -help </div><div><br></div><div>But I see no mention of hello in the output. I am using MacOSX Lion, and the llvm code is something that I checked out recently from the trunk. I ran nm on pass.so and the symbols for hello are present just fine. </div>

<div><br></div><div>Not sure what is that I missing here. Any help? </div><div><br></div><div>Arpan</div>