[LLVMdev] Unwinds gone missing
nicholas at mxc.ca
Fri Dec 26 10:20:26 CST 2008
Matt Giuca wrote:
> Alastair Lynn wrote:
>> From what I understand, the unwind instruction is implemented only
>> for the interpreter: there is a -lowerunwind pass for compiling to
>> other systems which will either lower unwind and invoke to setjmp/
>> longjmp (slow) or turn invokes into calls and unwinds into abort()s.
> Ah cheers, Alastair. That could be very useful (at least for me personally,
> I don't mind the slow so much as long as it behaves correctly!)
> I did a bit of research. Looks like it's -lowerinvoke, not -lowerunwind.
> That provides the two options you describe.
> Now this question is perhaps getting a bit off-topic, but I can't find a
> tool which accepts the -lower* arguments. Is there a tool for running such
> passes? Or can it only be accessed from the C++ API side of LLVM?
opt. You can use it like:
$ opt -lowerinvoke in.bc -o out.bc
$ llvm-as < foo.ll | opt -lowerinvoke | llvm-dis
$ llvm-gcc -O2 foo.c -c -o - -emit-llvm | opt -lowerinvoke | llc -o foo.s
depending on what you're doing.
More information about the LLVMdev