[LLVMdev] Pass registered multiple times!

John Criswell criswell at cs.uiuc.edu
Mon Mar 31 13:05:33 PDT 2008


Lu Zhao wrote:
> It turned out to be the problem of this line in Makefile
>
> LLVMLIBS = LLVMCore.a LLVMSupport.a LLVMSystem.a
>
> The error is gone when I remove the above line.
>
> However, the pass output only contains one line of the main function.
>
> First: main
>
> It does not have puts and __main as shown in this page:
> http://llvm.org/docs/WritingAnLLVMPass.html#running
>
> So I guess the drived FunctionPass only works on the application
> functions, not on the library functions of LLVM. Is that right?
>   
LLVM does not distinguish between application and library functions, 
unless you mean that it distinguishes between defined functions and 
functions defined in another module.  It's possible that runOnFunction() 
is not called for functions with no function body (aka external 
declarations or external functions).

If you disassemble your input bytecode file and look at the LLVM 
disassembly, I'd bet that either __main() and puts are external 
functions with no function body or are not present in the file at all.

-- John T.
> Thanks.
> Lu
>
> On Mon, 31 Mar 2008 00:47:26 -0600
> Lu Zhao <luzhao at cs.utah.edu> wrote:
>
>   




More information about the llvm-dev mailing list