[LLVMdev] LLVM 3.0 oddity

Erik de Castro Lopo mle+cl at mega-nerd.com
Sun Nov 27 15:17:28 PST 2011


Óscar Fuentes wrote:

> Erik de Castro Lopo <mle+cl at mega-nerd.com> writes:
> 
> [snip]
> 
> >   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)  
> [snip]
> >  c) Am I doing something else wrong.
> 
> I guess that the problem is with the missing `align 8' on the `define'.

Nope, if I add an 'align 8' to the definition, I still get the
same error.

Here is a minimal test case:

    declare i32 @plus_two(i32)

    define i32 @plus_two(i32 %x) {
      %1 = add nsw i32 %x, 2
      ret i32 %1
    }

for which llc gives the error:


    llc: a.ll:4:12: error: invalid redefinition of function 'plus_two'
    define i32 @plus_two(i32 %x) {



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



More information about the llvm-dev mailing list