match ty::get(output).sty {
// functions returning bottom may unwind, but can never return normally
ty::ty_bot => {
- unsafe {
- llvm::LLVMAddFunctionAttribute(llfn,
- llvm::FunctionIndex as c_uint,
- llvm::NoReturnAttribute as uint64_t)
- }
+ llvm::SetFunctionAttribute(llfn, llvm::NoReturnAttribute)
}
_ => {}
}
if ccx.tcx().sess.opts.cg.no_redzone {
- unsafe {
- llvm::LLVMAddFunctionAttribute(llfn,
- llvm::FunctionIndex as c_uint,
- llvm::NoRedZoneAttribute as uint64_t)
- }
+ llvm::SetFunctionAttribute(llfn, llvm::NoRedZoneAttribute)
}
llvm::SetFunctionCallConv(llfn, cc);
tcx.sess.bug("unexpected variant: required trait method \
in has_nested_returns")
}
+ ast::TypeTraitItem(_) => {
+ tcx.sess.bug("unexpected variant: type trait item in \
+ has_nested_returns")
+ }
}
}
Some(ast_map::NodeImplItem(ii)) => {
ast::MethMac(_) => tcx.sess.bug("unexpanded macro")
}
}
+ ast::TypeImplItem(_) => {
+ tcx.sess.bug("unexpected variant: type impl item in \
+ has_nested_returns")
+ }
}
}
Some(ast_map::NodeExpr(e)) => {
needs_ret_allocas: nested_returns,
personality: Cell::new(None),
caller_expects_out_pointer: uses_outptr,
- llargs: RefCell::new(NodeMap::new()),
lllocals: RefCell::new(NodeMap::new()),
llupvars: RefCell::new(NodeMap::new()),
id: id,
ast_map::NodeTraitItem(trait_method) => {
debug!("get_item_val(): processing a NodeTraitItem");
match *trait_method {
- ast::RequiredMethod(_) => {
- ccx.sess().bug("unexpected variant: required trait method in \
- get_item_val()");
+ ast::RequiredMethod(_) | ast::TypeTraitItem(_) => {
+ ccx.sess().bug("unexpected variant: required trait \
+ method in get_item_val()");
}
ast::ProvidedMethod(ref m) => {
register_method(ccx, id, &**m)
ast_map::NodeImplItem(ii) => {
match *ii {
ast::MethodImplItem(ref m) => register_method(ccx, id, &**m),
+ ast::TypeImplItem(ref typedef) => {
+ ccx.sess().span_bug(typedef.span,
+ "unexpected variant: required impl \
+ method in get_item_val()")
+ }
}
}