[LLVMdev] LLVM 3.0 oddity

Erik de Castro Lopo mle+cl at mega-nerd.com
Sun Nov 27 12:10:37 PST 2011


Hi all,

In the LLVM backend for the DDC compiler, since version 2.7 I have
been doing the following:

  declare external ccc i32 @some_fn(%struct.Obj* ) align 8

  ; bunch more declarations and code.

  define external ccc i32 @some_fn(%struct.Obj*  %_p_vn)  
  {
  entry:

but now I'm getting an error at the function definition saying:

    error: invalid redefinition of function 'some_fn'

So my questions are:

 a) Is this a bug? Should llvm be allowing this?

 b) Is there a good reason why I should not be allowed both declare
    and a defined a function in the same module?

 c) Am I doing something else wrong.

Cheers,
Erik

-- 
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/



More information about the llvm-dev mailing list