[LLVMdev] Why exceptions don't work in JIT?

Yuri yuri at rawbw.com
Tue Jul 13 22:09:43 PDT 2010


When I try running simple example with exceptions through JIT I get this 
output:
terminate called after throwing an instance of 'E*'

Why exceptions don't work in JIT and what it takes to make them work?

Yuri

--- e.C ---
#include <stdio.h>
#include <stdlib.h>

class E {
};

void xmain() {
   try {
     throw new E;
   } catch (E *e) {
     printf("caught!\n");
   }
   printf("done\n");
}

--- commands ---
clang++ -O3 -fexceptions -emit-llvm -S -o e.ll e.C
llvm-as e.ll
lli --entry-function=_Z5xmainv e.bc




More information about the llvm-dev mailing list