[LLVMdev] boost shared pointer & llvm

Török Edwin edwintorok at gmail.com
Tue Jul 21 04:58:53 PDT 2009


On 2009-07-21 14:27, Stefan Weigert wrote:
> hi,
>
> when using the execution engine (no matter, if JIT or Interpreter) i get the 
> following assertion as soon as i use boost::shared_ptr:
>
> /build/buildd/llvm-2.5/lib/Target/X86/X86CodeEmitter.cpp:522: 
> void<unnamed>::Emitter::emitInstruction(const llvm::MachineInstr&, const 
> llvm::TargetInstrDesc*): Assertion `0 && "JIT does not support inline asm!\n"' 
> failed.
>
> how can i find out which instruction is executed at this point or in which 
> function we are currently?
>
> i also attached a very small example, which triggers the assertion when run 
> with lli.
>
>   

llvm-g++ -g ~/test.cpp -o test.bc -c -emit-llvm
opt -print-dbginfo test.bc > test.ll

Then open test.ll, and look for 'asm', and closest sourceline:
function _ZN5boost6detail23atomic_exchange_and_addEPii
entry:; (sp_counted_base_gcc_x86.hpp:50)
...
    %asmtmp = call i32 asm sideeffect "lock\0A\09xadd $1, $0",
"=*m,=r,*m,1,~{dirflag},~{fpsr},~{flags},~{cc},~{memory}"(i32* %4, i32*
%5, i32 %6) nounwind        ; <i32> [#uses=1]    store i32 %asmtmp, i32*
%r; %r is variable r of type int declared at sp_counted_base_gcc_x86.hpp:41
; sp_counted_base_gcc_x86.hpp:52

echo _ZN5boost6detail23atomic_exchange_and_addEPii | c++filt
boost::detail::atomic_exchange_and_add(int*, int

Best regards,
--Edwin





More information about the llvm-dev mailing list