IRGen: Enable usage of attributes from RuntimeFunctions.def

* Add some ZExt function attributes on functions returning bool
* swift_dynamicCast is not readonly as it writes to the 'dest' buffer
* Fix tail_alloc.sil test

rdar://20802330
This commit is contained in:
Arnold Schwaighofer
2017-07-25 14:35:03 -07:00
parent aca4caea8d
commit ee17bab396
3 changed files with 18 additions and 20 deletions

View File

@@ -468,18 +468,16 @@ llvm::Constant *swift::getRuntimeFn(llvm::Module &Module,
}
// FIXME: getting attributes here without setting them does
// nothing. This cannot be fixed until the attributes are correctly specified.
fn->getAttributes().
addAttributes(Module.getContext(),
llvm::AttributeSet::FunctionIndex,
llvm::AttributeSet::get(Module.getContext(),
llvm::AttributeSet::FunctionIndex,
buildFnAttr));
fn->getAttributes().
addAttributes(Module.getContext(),
llvm::AttributeSet::ReturnIndex,
llvm::AttributeSet::get(Module.getContext(),
llvm::AttributeSet::ReturnIndex,
buildRetAttr));
fn->setAttributes(fn->getAttributes().addAttributes(
Module.getContext(), llvm::AttributeSet::FunctionIndex,
llvm::AttributeSet::get(Module.getContext(),
llvm::AttributeSet::FunctionIndex,
buildFnAttr)));
fn->setAttributes(fn->getAttributes().addAttributes(
Module.getContext(), llvm::AttributeSet::ReturnIndex,
llvm::AttributeSet::get(Module.getContext(),
llvm::AttributeSet::ReturnIndex,
buildRetAttr)));
}
return cache;