[LLVMdev] globals, modules and badref.

Óscar Fuentes ofv at wanadoo.es
Mon Aug 10 21:05:16 PDT 2009


While adapting my JIT compiler to ToT coming from 2.5, I found this:

Referencing global in another module!
        %3 = bitcast [8 x i8]** <badref> to i8*         ; <i8*> [#uses=1]Instruction

<badref> is a naked (void*) pointer. This worked on 2.5 without problem.

I tried creating a GlobalVariable:

external constant [8 x i8]*              ; <[8 x i8]**>:<badref> [#uses=0]

but there it is <badref> again (and the declaration does not shows on
the generated llvm assembly file).

The compiler creates only one module. How can LLVM complain about the
global being on another module?

How to fix this?

Is it documented somewhere? (there is no mention of <badref> on the
Language Reference Manual)

-- 
Óscar




More information about the llvm-dev mailing list