Add "noreturn" attribute : stage 1

- Add the attribute to AnyFunctionType::ExtInfo.
- Propagate the attributes from DeclAttributes to AnyFunctionType for
  FuncDecls in TypeCheckDecl.cpp.
- Make sure the new attribute is serialized.

The main missing pieces are checking the applicability of the type attributes
on the FuncDecl and teaching typechecker about conversions on types with
noreturn.

Swift SVN r6359
This commit is contained in:
Anna Zaks
2013-07-18 22:57:22 +00:00
parent 92e07c6a54
commit 74bc6f05b2
13 changed files with 116 additions and 28 deletions

View File

@@ -1097,6 +1097,8 @@ bool Serializer::writeDecl(const Decl *D) {
attrs.Assignment = false;
attrs.Conversion = false;
attrs.AsmName = {};
attrs.NoReturn = false;
attrs.Thin = false;
// FIXME: Handle other attributes.
if (!attrs.empty())
@@ -1393,6 +1395,7 @@ bool Serializer::writeType(Type ty) {
getRawStableCC(fnTy->getAbstractCC()),
fnTy->isAutoClosure(),
fnTy->isThin(),
fnTy->isNoReturn(),
fnTy->isBlock());
return true;
@@ -1409,7 +1412,8 @@ bool Serializer::writeType(Type ty) {
addTypeRef(fnTy->getResult()),
addDeclRef(genericContext),
getRawStableCC(callingConvention),
fnTy->isThin());
fnTy->isThin(),
fnTy->isNoReturn());
return true;
}