0
votes

I am trying to load the provided hello pass into LLVM 3.0, compiled with clang. I am running on a mac, 10.7 I get this when trying to load:

$ opt -load ../../../Debug/lib/LLVMHello.dylib -hello < hello.bc > /dev/null Hello: __cxx_global_var_init Hello: _ZN4llvm12RegisterPassIN12_GLOBAL__N_15HelloEEC1EPKcS5_bb Hello: _ZN4llvm12RegisterPassIN12_GLOBAL__N_15HelloEED1Ev Hello: __cxx_global_var_init2 Hello: _ZN4llvm12RegisterPassIN12_GLOBAL__N_16Hello2EEC1EPKcS5_bb Hello: _ZN4llvm12RegisterPassIN12_GLOBAL__N_16Hello2EED1Ev Hello: _ZN4llvm12RegisterPassIN12_GLOBAL__N_16Hello2EEC2EPKcS5_bb Hello: _ZN4llvm8PassInfoC2EPKcS2_PKvPFPNS_4PassEvEbb Hello: _ZN4llvm15callDefaultCtorIN12_GLOBAL__N_16Hello2EEEPNS_4PassEv ... Hello: _ZN12_GLOBAL__N_15Hello13runOnFunctionERN4llvm8FunctionE Hello: _ZN12_GLOBAL__N_15HelloD2Ev Hello: _ZN4llvm12RegisterPassIN12_GLOBAL__N_16Hello2EED2Ev Hello: _ZN4llvm12RegisterPassIN12_GLOBAL__N_15HelloEED2Ev Hello: GLOBAL_I_a

I then look for the pass with opt -help but I do not see it.

I try to replace RegisterPass with RegisterOpt but that only results in compile errors.

Any suggestions?

1

1 Answers

0
votes

Nevermind. I realized the first line actually loads the pass and runs it over hello.bc and prints out the functions within hello.bc. I thought that line was only to load.