dylan-lang/opendylan — pull request #222 by waywardmonkeys (2012-05-23 03:33:56+00:00)
Title: Remove 'unwind' instruction.

The unwind instruction is gone in LLVM 3.1. This is for @housel, hoping it helps out some.

A couple of questions about this ...

I'm assuming this should stay:

````dylan
$llvm-intrinsic-makers["llvm.eh.unwind.init"]
:= begin
let function-type
= make(,
return-type: $llvm-void-type,
parameter-types: vector(),
varargs?: #f);
let function
= make(,
name: "llvm.eh.unwind.init",
type: make(, pointee: function-type),
attribute-list: $llvm-intrinsic-default-attribute-list,
linkage: #"external");
method (arguments) function end
end;
````

And the unwind here:

````dylan
op invoke (to, unwind, fnptrval, args :: ,
#rest options, #key metadata ::

= #(), #all-keys)
=> apply(make, ,
operands: map(curry(llvm-builder-value, builder),
concatenate(vector(to, unwind, fnptrval), args)),
metadata: builder-metadata(builder, metadata),
options);
````

And in this:

````dylan
%INVOKE opt-calling-conv opt-ret-attrs result-types value-ref
%LPAREN param-list %RPAREN opt-func-attrs
%TO %LABEL value-ref
%UNWIND %LABEL value-ref opt-inst-metadata
=> begin
let type = arg$4;
let return-type
= if (instance?(type, ))
let pointee
= llvm-type-forward(type.llvm-pointer-type-pointee);
if (instance?(pointee, ))
llvm-constrain-type(llvm-value-type(arg$5), type);
llvm-type-forward(pointee.llvm-function-type-return-type)
else
type
end if
else
type
end if;
llvm-constrain-type(llvm-value-type(arg$12), $llvm-label-type);
llvm-constrain-type(llvm-value-type(arg$15), $llvm-label-type);
let param-list = reverse!(arg$7);
let (return-attributes, function-attributes)
= munge-attributes(arg$3, arg$9);
let attribute-list
= make(,
return-attributes: return-attributes,
function-attributes: function-attributes,
parameter-attributes: map(param-attributes, param-list));
make(,
type: return-type,
attribute-list: attribute-list,
calling-convention: arg$2,
operands: concatenate(vector(arg$12, arg$15, arg$5),
map(param-value, param-list)),
metadata: arg$16)
end;;
````

Should the ``UNWIND`` remain there? If so, do I need to keep the ``"unwind" => $%UNWIND-token`` that was in ``llvm-asm-reader.dylan``?