forked from OSchip/llvm-project
Eliminate the default arguments to ASTContext::getFunctionType(),
fixing up a few callers that thought they were propagating NoReturn information but were in fact saying something about exception specifications. llvm-svn: 96766
This commit is contained in:
parent
7126183006
commit
36c569fb33
|
@ -529,11 +529,11 @@ public:
|
||||||
/// list. isVariadic indicates whether the argument list includes '...'.
|
/// list. isVariadic indicates whether the argument list includes '...'.
|
||||||
QualType getFunctionType(QualType ResultTy, const QualType *ArgArray,
|
QualType getFunctionType(QualType ResultTy, const QualType *ArgArray,
|
||||||
unsigned NumArgs, bool isVariadic,
|
unsigned NumArgs, bool isVariadic,
|
||||||
unsigned TypeQuals, bool hasExceptionSpec = false,
|
unsigned TypeQuals, bool hasExceptionSpec,
|
||||||
bool hasAnyExceptionSpec = false,
|
bool hasAnyExceptionSpec,
|
||||||
unsigned NumExs = 0, const QualType *ExArray = 0,
|
unsigned NumExs, const QualType *ExArray,
|
||||||
bool NoReturn = false,
|
bool NoReturn,
|
||||||
CallingConv CallConv = CC_Default);
|
CallingConv CallConv);
|
||||||
|
|
||||||
/// getTypeDeclType - Return the unique reference to the type for
|
/// getTypeDeclType - Return the unique reference to the type for
|
||||||
/// the specified type declaration.
|
/// the specified type declaration.
|
||||||
|
|
|
@ -1045,7 +1045,9 @@ public:
|
||||||
SourceLocation DestroyedTypeLoc)
|
SourceLocation DestroyedTypeLoc)
|
||||||
: Expr(CXXPseudoDestructorExprClass,
|
: Expr(CXXPseudoDestructorExprClass,
|
||||||
Context.getPointerType(Context.getFunctionType(Context.VoidTy, 0, 0,
|
Context.getPointerType(Context.getFunctionType(Context.VoidTy, 0, 0,
|
||||||
false, 0)),
|
false, 0, false,
|
||||||
|
false, 0, 0, false,
|
||||||
|
CC_Default)),
|
||||||
/*isTypeDependent=*/false,
|
/*isTypeDependent=*/false,
|
||||||
/*isValueDependent=*/Base->isValueDependent()),
|
/*isValueDependent=*/Base->isValueDependent()),
|
||||||
Base(static_cast<Stmt *>(Base)), IsArrow(isArrow),
|
Base(static_cast<Stmt *>(Base)), IsArrow(isArrow),
|
||||||
|
|
|
@ -4408,7 +4408,8 @@ QualType ASTContext::mergeFunctionTypes(QualType lhs, QualType rhs) {
|
||||||
if (allRTypes) return rhs;
|
if (allRTypes) return rhs;
|
||||||
return getFunctionType(retType, proto->arg_type_begin(),
|
return getFunctionType(retType, proto->arg_type_begin(),
|
||||||
proto->getNumArgs(), proto->isVariadic(),
|
proto->getNumArgs(), proto->isVariadic(),
|
||||||
proto->getTypeQuals(), NoReturn, lcc);
|
proto->getTypeQuals(),
|
||||||
|
false, false, 0, 0, NoReturn, lcc);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (allLTypes) return lhs;
|
if (allLTypes) return lhs;
|
||||||
|
@ -4895,8 +4896,11 @@ QualType ASTContext::GetBuiltinType(unsigned id,
|
||||||
// handle untyped/variadic arguments "T c99Style();" or "T cppStyle(...);".
|
// handle untyped/variadic arguments "T c99Style();" or "T cppStyle(...);".
|
||||||
if (ArgTypes.size() == 0 && TypeStr[0] == '.')
|
if (ArgTypes.size() == 0 && TypeStr[0] == '.')
|
||||||
return getFunctionNoProtoType(ResType);
|
return getFunctionNoProtoType(ResType);
|
||||||
|
|
||||||
|
// FIXME: Should we create noreturn types?
|
||||||
return getFunctionType(ResType, ArgTypes.data(), ArgTypes.size(),
|
return getFunctionType(ResType, ArgTypes.data(), ArgTypes.size(),
|
||||||
TypeStr[0] == '.', 0);
|
TypeStr[0] == '.', 0, false, false, 0, 0,
|
||||||
|
false, CC_Default);
|
||||||
}
|
}
|
||||||
|
|
||||||
QualType
|
QualType
|
||||||
|
|
|
@ -197,7 +197,10 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy,
|
||||||
|
|
||||||
Builder.SetInsertPoint(EntryBB);
|
Builder.SetInsertPoint(EntryBB);
|
||||||
|
|
||||||
QualType FnType = getContext().getFunctionType(RetTy, 0, 0, false, 0);
|
QualType FnType = getContext().getFunctionType(RetTy, 0, 0, false, 0,
|
||||||
|
false, false, 0, 0,
|
||||||
|
/*FIXME?*/false,
|
||||||
|
/*FIXME?*/CC_Default);
|
||||||
|
|
||||||
// Emit subprogram debug descriptor.
|
// Emit subprogram debug descriptor.
|
||||||
if (CGDebugInfo *DI = getDebugInfo()) {
|
if (CGDebugInfo *DI = getDebugInfo()) {
|
||||||
|
|
|
@ -2165,8 +2165,10 @@ void RewriteObjC::SynthSelGetUidFunctionDecl() {
|
||||||
llvm::SmallVector<QualType, 16> ArgTys;
|
llvm::SmallVector<QualType, 16> ArgTys;
|
||||||
ArgTys.push_back(Context->getPointerType(Context->CharTy.withConst()));
|
ArgTys.push_back(Context->getPointerType(Context->CharTy.withConst()));
|
||||||
QualType getFuncType = Context->getFunctionType(Context->getObjCSelType(),
|
QualType getFuncType = Context->getFunctionType(Context->getObjCSelType(),
|
||||||
&ArgTys[0], ArgTys.size(),
|
&ArgTys[0], ArgTys.size(),
|
||||||
false /*isVariadic*/, 0);
|
false /*isVariadic*/, 0,
|
||||||
|
false, false, 0, 0, false,
|
||||||
|
CC_Default);
|
||||||
SelGetUidFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
|
SelGetUidFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
|
||||||
SourceLocation(),
|
SourceLocation(),
|
||||||
SelGetUidIdent, getFuncType, 0,
|
SelGetUidIdent, getFuncType, 0,
|
||||||
|
@ -2261,7 +2263,9 @@ void RewriteObjC::SynthSuperContructorFunctionDecl() {
|
||||||
ArgTys.push_back(argT);
|
ArgTys.push_back(argT);
|
||||||
QualType msgSendType = Context->getFunctionType(Context->getObjCIdType(),
|
QualType msgSendType = Context->getFunctionType(Context->getObjCIdType(),
|
||||||
&ArgTys[0], ArgTys.size(),
|
&ArgTys[0], ArgTys.size(),
|
||||||
false, 0);
|
false, 0,
|
||||||
|
false, false, 0, 0, false,
|
||||||
|
CC_Default);
|
||||||
SuperContructorFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
|
SuperContructorFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
|
||||||
SourceLocation(),
|
SourceLocation(),
|
||||||
msgSendIdent, msgSendType, 0,
|
msgSendIdent, msgSendType, 0,
|
||||||
|
@ -2280,7 +2284,9 @@ void RewriteObjC::SynthMsgSendFunctionDecl() {
|
||||||
ArgTys.push_back(argT);
|
ArgTys.push_back(argT);
|
||||||
QualType msgSendType = Context->getFunctionType(Context->getObjCIdType(),
|
QualType msgSendType = Context->getFunctionType(Context->getObjCIdType(),
|
||||||
&ArgTys[0], ArgTys.size(),
|
&ArgTys[0], ArgTys.size(),
|
||||||
true /*isVariadic*/, 0);
|
true /*isVariadic*/, 0,
|
||||||
|
false, false, 0, 0, false,
|
||||||
|
CC_Default);
|
||||||
MsgSendFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
|
MsgSendFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
|
||||||
SourceLocation(),
|
SourceLocation(),
|
||||||
msgSendIdent, msgSendType, 0,
|
msgSendIdent, msgSendType, 0,
|
||||||
|
@ -2302,7 +2308,9 @@ void RewriteObjC::SynthMsgSendSuperFunctionDecl() {
|
||||||
ArgTys.push_back(argT);
|
ArgTys.push_back(argT);
|
||||||
QualType msgSendType = Context->getFunctionType(Context->getObjCIdType(),
|
QualType msgSendType = Context->getFunctionType(Context->getObjCIdType(),
|
||||||
&ArgTys[0], ArgTys.size(),
|
&ArgTys[0], ArgTys.size(),
|
||||||
true /*isVariadic*/, 0);
|
true /*isVariadic*/, 0,
|
||||||
|
false, false, 0, 0, false,
|
||||||
|
CC_Default);
|
||||||
MsgSendSuperFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
|
MsgSendSuperFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
|
||||||
SourceLocation(),
|
SourceLocation(),
|
||||||
msgSendIdent, msgSendType, 0,
|
msgSendIdent, msgSendType, 0,
|
||||||
|
@ -2321,7 +2329,9 @@ void RewriteObjC::SynthMsgSendStretFunctionDecl() {
|
||||||
ArgTys.push_back(argT);
|
ArgTys.push_back(argT);
|
||||||
QualType msgSendType = Context->getFunctionType(Context->getObjCIdType(),
|
QualType msgSendType = Context->getFunctionType(Context->getObjCIdType(),
|
||||||
&ArgTys[0], ArgTys.size(),
|
&ArgTys[0], ArgTys.size(),
|
||||||
true /*isVariadic*/, 0);
|
true /*isVariadic*/, 0,
|
||||||
|
false, false, 0, 0, false,
|
||||||
|
CC_Default);
|
||||||
MsgSendStretFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
|
MsgSendStretFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
|
||||||
SourceLocation(),
|
SourceLocation(),
|
||||||
msgSendIdent, msgSendType, 0,
|
msgSendIdent, msgSendType, 0,
|
||||||
|
@ -2345,7 +2355,9 @@ void RewriteObjC::SynthMsgSendSuperStretFunctionDecl() {
|
||||||
ArgTys.push_back(argT);
|
ArgTys.push_back(argT);
|
||||||
QualType msgSendType = Context->getFunctionType(Context->getObjCIdType(),
|
QualType msgSendType = Context->getFunctionType(Context->getObjCIdType(),
|
||||||
&ArgTys[0], ArgTys.size(),
|
&ArgTys[0], ArgTys.size(),
|
||||||
true /*isVariadic*/, 0);
|
true /*isVariadic*/, 0,
|
||||||
|
false, false, 0, 0, false,
|
||||||
|
CC_Default);
|
||||||
MsgSendSuperStretFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
|
MsgSendSuperStretFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
|
||||||
SourceLocation(),
|
SourceLocation(),
|
||||||
msgSendIdent, msgSendType, 0,
|
msgSendIdent, msgSendType, 0,
|
||||||
|
@ -2364,7 +2376,9 @@ void RewriteObjC::SynthMsgSendFpretFunctionDecl() {
|
||||||
ArgTys.push_back(argT);
|
ArgTys.push_back(argT);
|
||||||
QualType msgSendType = Context->getFunctionType(Context->DoubleTy,
|
QualType msgSendType = Context->getFunctionType(Context->DoubleTy,
|
||||||
&ArgTys[0], ArgTys.size(),
|
&ArgTys[0], ArgTys.size(),
|
||||||
true /*isVariadic*/, 0);
|
true /*isVariadic*/, 0,
|
||||||
|
false, false, 0, 0, false,
|
||||||
|
CC_Default);
|
||||||
MsgSendFpretFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
|
MsgSendFpretFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
|
||||||
SourceLocation(),
|
SourceLocation(),
|
||||||
msgSendIdent, msgSendType, 0,
|
msgSendIdent, msgSendType, 0,
|
||||||
|
@ -2378,7 +2392,9 @@ void RewriteObjC::SynthGetClassFunctionDecl() {
|
||||||
ArgTys.push_back(Context->getPointerType(Context->CharTy.withConst()));
|
ArgTys.push_back(Context->getPointerType(Context->CharTy.withConst()));
|
||||||
QualType getClassType = Context->getFunctionType(Context->getObjCIdType(),
|
QualType getClassType = Context->getFunctionType(Context->getObjCIdType(),
|
||||||
&ArgTys[0], ArgTys.size(),
|
&ArgTys[0], ArgTys.size(),
|
||||||
false /*isVariadic*/, 0);
|
false /*isVariadic*/, 0,
|
||||||
|
false, false, 0, 0, false,
|
||||||
|
CC_Default);
|
||||||
GetClassFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
|
GetClassFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
|
||||||
SourceLocation(),
|
SourceLocation(),
|
||||||
getClassIdent, getClassType, 0,
|
getClassIdent, getClassType, 0,
|
||||||
|
@ -2392,7 +2408,9 @@ void RewriteObjC::SynthGetMetaClassFunctionDecl() {
|
||||||
ArgTys.push_back(Context->getPointerType(Context->CharTy.withConst()));
|
ArgTys.push_back(Context->getPointerType(Context->CharTy.withConst()));
|
||||||
QualType getClassType = Context->getFunctionType(Context->getObjCIdType(),
|
QualType getClassType = Context->getFunctionType(Context->getObjCIdType(),
|
||||||
&ArgTys[0], ArgTys.size(),
|
&ArgTys[0], ArgTys.size(),
|
||||||
false /*isVariadic*/, 0);
|
false /*isVariadic*/, 0,
|
||||||
|
false, false, 0, 0, false,
|
||||||
|
CC_Default);
|
||||||
GetMetaClassFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
|
GetMetaClassFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
|
||||||
SourceLocation(),
|
SourceLocation(),
|
||||||
getClassIdent, getClassType, 0,
|
getClassIdent, getClassType, 0,
|
||||||
|
@ -2804,7 +2822,9 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp) {
|
||||||
QualType castType = Context->getFunctionType(returnType,
|
QualType castType = Context->getFunctionType(returnType,
|
||||||
&ArgTypes[0], ArgTypes.size(),
|
&ArgTypes[0], ArgTypes.size(),
|
||||||
// If we don't have a method decl, force a variadic cast.
|
// If we don't have a method decl, force a variadic cast.
|
||||||
Exp->getMethodDecl() ? Exp->getMethodDecl()->isVariadic() : true, 0);
|
Exp->getMethodDecl() ? Exp->getMethodDecl()->isVariadic() : true, 0,
|
||||||
|
false, false, 0, 0, false,
|
||||||
|
CC_Default);
|
||||||
castType = Context->getPointerType(castType);
|
castType = Context->getPointerType(castType);
|
||||||
cast = NoTypeInfoCStyleCastExpr(Context, castType, CastExpr::CK_Unknown,
|
cast = NoTypeInfoCStyleCastExpr(Context, castType, CastExpr::CK_Unknown,
|
||||||
cast);
|
cast);
|
||||||
|
@ -2833,7 +2853,9 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp) {
|
||||||
// Now do the "normal" pointer to function cast.
|
// Now do the "normal" pointer to function cast.
|
||||||
castType = Context->getFunctionType(returnType,
|
castType = Context->getFunctionType(returnType,
|
||||||
&ArgTypes[0], ArgTypes.size(),
|
&ArgTypes[0], ArgTypes.size(),
|
||||||
Exp->getMethodDecl() ? Exp->getMethodDecl()->isVariadic() : false, 0);
|
Exp->getMethodDecl() ? Exp->getMethodDecl()->isVariadic() : false, 0,
|
||||||
|
false, false, 0, 0, false,
|
||||||
|
CC_Default);
|
||||||
castType = Context->getPointerType(castType);
|
castType = Context->getPointerType(castType);
|
||||||
cast = NoTypeInfoCStyleCastExpr(Context, castType, CastExpr::CK_Unknown,
|
cast = NoTypeInfoCStyleCastExpr(Context, castType, CastExpr::CK_Unknown,
|
||||||
cast);
|
cast);
|
||||||
|
@ -4306,7 +4328,9 @@ Stmt *RewriteObjC::SynthesizeBlockCall(CallExpr *Exp, const Expr *BlockExp) {
|
||||||
}
|
}
|
||||||
// Now do the pointer to function cast.
|
// Now do the pointer to function cast.
|
||||||
QualType PtrToFuncCastType = Context->getFunctionType(Exp->getType(),
|
QualType PtrToFuncCastType = Context->getFunctionType(Exp->getType(),
|
||||||
&ArgTypes[0], ArgTypes.size(), false/*no variadic*/, 0);
|
&ArgTypes[0], ArgTypes.size(), false/*no variadic*/, 0,
|
||||||
|
false, false, 0, 0,
|
||||||
|
false, CC_Default);
|
||||||
|
|
||||||
PtrToFuncCastType = Context->getPointerType(PtrToFuncCastType);
|
PtrToFuncCastType = Context->getPointerType(PtrToFuncCastType);
|
||||||
|
|
||||||
|
|
|
@ -1103,7 +1103,10 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New, Decl *OldD) {
|
||||||
NewQType = Context.getFunctionType(NewFuncType->getResultType(),
|
NewQType = Context.getFunctionType(NewFuncType->getResultType(),
|
||||||
ParamTypes.data(), ParamTypes.size(),
|
ParamTypes.data(), ParamTypes.size(),
|
||||||
OldProto->isVariadic(),
|
OldProto->isVariadic(),
|
||||||
OldProto->getTypeQuals());
|
OldProto->getTypeQuals(),
|
||||||
|
false, false, 0, 0,
|
||||||
|
OldProto->getNoReturnAttr(),
|
||||||
|
OldProto->getCallConv());
|
||||||
New->setType(NewQType);
|
New->setType(NewQType);
|
||||||
New->setHasInheritedPrototype();
|
New->setHasInheritedPrototype();
|
||||||
|
|
||||||
|
@ -1182,7 +1185,10 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New, Decl *OldD) {
|
||||||
|
|
||||||
New->setType(Context.getFunctionType(MergedReturn, &ArgTypes[0],
|
New->setType(Context.getFunctionType(MergedReturn, &ArgTypes[0],
|
||||||
ArgTypes.size(),
|
ArgTypes.size(),
|
||||||
OldProto->isVariadic(), 0));
|
OldProto->isVariadic(), 0,
|
||||||
|
false, false, 0, 0,
|
||||||
|
OldProto->getNoReturnAttr(),
|
||||||
|
OldProto->getCallConv()));
|
||||||
return MergeCompatibleFunctionDecls(New, Old);
|
return MergeCompatibleFunctionDecls(New, Old);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3226,7 +3232,7 @@ void Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD,
|
||||||
// Turn this into a variadic function with no parameters.
|
// Turn this into a variadic function with no parameters.
|
||||||
QualType R = Context.getFunctionType(
|
QualType R = Context.getFunctionType(
|
||||||
NewFD->getType()->getAs<FunctionType>()->getResultType(),
|
NewFD->getType()->getAs<FunctionType>()->getResultType(),
|
||||||
0, 0, true, 0);
|
0, 0, true, 0, false, false, 0, 0, false, CC_Default);
|
||||||
NewFD->setType(R);
|
NewFD->setType(R);
|
||||||
return NewFD->setInvalidDecl();
|
return NewFD->setInvalidDecl();
|
||||||
}
|
}
|
||||||
|
|
|
@ -2174,7 +2174,10 @@ void Sema::AddImplicitlyDeclaredMembersToClass(CXXRecordDecl *ClassDecl) {
|
||||||
CXXConstructorDecl::Create(Context, ClassDecl,
|
CXXConstructorDecl::Create(Context, ClassDecl,
|
||||||
ClassDecl->getLocation(), Name,
|
ClassDecl->getLocation(), Name,
|
||||||
Context.getFunctionType(Context.VoidTy,
|
Context.getFunctionType(Context.VoidTy,
|
||||||
0, 0, false, 0),
|
0, 0, false, 0,
|
||||||
|
/*FIXME*/false, false,
|
||||||
|
0, 0, false,
|
||||||
|
CC_Default),
|
||||||
/*TInfo=*/0,
|
/*TInfo=*/0,
|
||||||
/*isExplicit=*/false,
|
/*isExplicit=*/false,
|
||||||
/*isInline=*/true,
|
/*isInline=*/true,
|
||||||
|
@ -2246,7 +2249,10 @@ void Sema::AddImplicitlyDeclaredMembersToClass(CXXRecordDecl *ClassDecl) {
|
||||||
ClassDecl->getLocation(), Name,
|
ClassDecl->getLocation(), Name,
|
||||||
Context.getFunctionType(Context.VoidTy,
|
Context.getFunctionType(Context.VoidTy,
|
||||||
&ArgType, 1,
|
&ArgType, 1,
|
||||||
false, 0),
|
false, 0,
|
||||||
|
/*FIXME:*/false,
|
||||||
|
false, 0, 0, false,
|
||||||
|
CC_Default),
|
||||||
/*TInfo=*/0,
|
/*TInfo=*/0,
|
||||||
/*isExplicit=*/false,
|
/*isExplicit=*/false,
|
||||||
/*isInline=*/true,
|
/*isInline=*/true,
|
||||||
|
@ -2332,7 +2338,10 @@ void Sema::AddImplicitlyDeclaredMembersToClass(CXXRecordDecl *ClassDecl) {
|
||||||
CXXMethodDecl *CopyAssignment =
|
CXXMethodDecl *CopyAssignment =
|
||||||
CXXMethodDecl::Create(Context, ClassDecl, ClassDecl->getLocation(), Name,
|
CXXMethodDecl::Create(Context, ClassDecl, ClassDecl->getLocation(), Name,
|
||||||
Context.getFunctionType(RetType, &ArgType, 1,
|
Context.getFunctionType(RetType, &ArgType, 1,
|
||||||
false, 0),
|
false, 0,
|
||||||
|
/*FIXME:*/false,
|
||||||
|
false, 0, 0, false,
|
||||||
|
CC_Default),
|
||||||
/*TInfo=*/0, /*isStatic=*/false, /*isInline=*/true);
|
/*TInfo=*/0, /*isStatic=*/false, /*isInline=*/true);
|
||||||
CopyAssignment->setAccess(AS_public);
|
CopyAssignment->setAccess(AS_public);
|
||||||
CopyAssignment->setImplicit();
|
CopyAssignment->setImplicit();
|
||||||
|
@ -2364,7 +2373,10 @@ void Sema::AddImplicitlyDeclaredMembersToClass(CXXRecordDecl *ClassDecl) {
|
||||||
= CXXDestructorDecl::Create(Context, ClassDecl,
|
= CXXDestructorDecl::Create(Context, ClassDecl,
|
||||||
ClassDecl->getLocation(), Name,
|
ClassDecl->getLocation(), Name,
|
||||||
Context.getFunctionType(Context.VoidTy,
|
Context.getFunctionType(Context.VoidTy,
|
||||||
0, 0, false, 0),
|
0, 0, false, 0,
|
||||||
|
/*FIXME:*/false,
|
||||||
|
false, 0, 0, false,
|
||||||
|
CC_Default),
|
||||||
/*isInline=*/true,
|
/*isInline=*/true,
|
||||||
/*isImplicitlyDeclared=*/true);
|
/*isImplicitlyDeclared=*/true);
|
||||||
Destructor->setAccess(AS_public);
|
Destructor->setAccess(AS_public);
|
||||||
|
@ -2523,7 +2535,13 @@ QualType Sema::CheckConstructorDeclarator(Declarator &D, QualType R,
|
||||||
const FunctionProtoType *Proto = R->getAs<FunctionProtoType>();
|
const FunctionProtoType *Proto = R->getAs<FunctionProtoType>();
|
||||||
return Context.getFunctionType(Context.VoidTy, Proto->arg_type_begin(),
|
return Context.getFunctionType(Context.VoidTy, Proto->arg_type_begin(),
|
||||||
Proto->getNumArgs(),
|
Proto->getNumArgs(),
|
||||||
Proto->isVariadic(), 0);
|
Proto->isVariadic(), 0,
|
||||||
|
Proto->hasExceptionSpec(),
|
||||||
|
Proto->hasAnyExceptionSpec(),
|
||||||
|
Proto->getNumExceptions(),
|
||||||
|
Proto->exception_begin(),
|
||||||
|
Proto->getNoReturnAttr(),
|
||||||
|
Proto->getCallConv());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// CheckConstructor - Checks a fully-formed constructor for
|
/// CheckConstructor - Checks a fully-formed constructor for
|
||||||
|
@ -2680,7 +2698,9 @@ QualType Sema::CheckDestructorDeclarator(Declarator &D,
|
||||||
// "void" as the return type, since destructors don't have return
|
// "void" as the return type, since destructors don't have return
|
||||||
// types. We *always* have to do this, because GetTypeForDeclarator
|
// types. We *always* have to do this, because GetTypeForDeclarator
|
||||||
// will put in a result type of "int" when none was specified.
|
// will put in a result type of "int" when none was specified.
|
||||||
return Context.getFunctionType(Context.VoidTy, 0, 0, false, 0);
|
// FIXME: Exceptions!
|
||||||
|
return Context.getFunctionType(Context.VoidTy, 0, 0, false, 0,
|
||||||
|
false, false, 0, 0, false, CC_Default);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// CheckConversionDeclarator - Called by ActOnDeclarator to check the
|
/// CheckConversionDeclarator - Called by ActOnDeclarator to check the
|
||||||
|
@ -2749,8 +2769,15 @@ void Sema::CheckConversionDeclarator(Declarator &D, QualType &R,
|
||||||
// Rebuild the function type "R" without any parameters (in case any
|
// Rebuild the function type "R" without any parameters (in case any
|
||||||
// of the errors above fired) and with the conversion type as the
|
// of the errors above fired) and with the conversion type as the
|
||||||
// return type.
|
// return type.
|
||||||
|
const FunctionProtoType *Proto = R->getAs<FunctionProtoType>();
|
||||||
R = Context.getFunctionType(ConvType, 0, 0, false,
|
R = Context.getFunctionType(ConvType, 0, 0, false,
|
||||||
R->getAs<FunctionProtoType>()->getTypeQuals());
|
Proto->getTypeQuals(),
|
||||||
|
Proto->hasExceptionSpec(),
|
||||||
|
Proto->hasAnyExceptionSpec(),
|
||||||
|
Proto->getNumExceptions(),
|
||||||
|
Proto->exception_begin(),
|
||||||
|
Proto->getNoReturnAttr(),
|
||||||
|
Proto->getCallConv());
|
||||||
|
|
||||||
// C++0x explicit conversion operators.
|
// C++0x explicit conversion operators.
|
||||||
if (D.getDeclSpec().isExplicitSpecified() && !getLangOptions().CPlusPlus0x)
|
if (D.getDeclSpec().isExplicitSpecified() && !getLangOptions().CPlusPlus0x)
|
||||||
|
|
|
@ -6802,7 +6802,8 @@ void Sema::ActOnBlockArguments(Declarator &ParamInfo, Scope *CurScope) {
|
||||||
|
|
||||||
// The parameter list is optional, if there was none, assume ().
|
// The parameter list is optional, if there was none, assume ().
|
||||||
if (!T->isFunctionType())
|
if (!T->isFunctionType())
|
||||||
T = Context.getFunctionType(T, NULL, 0, 0, 0);
|
T = Context.getFunctionType(T, 0, 0, false, 0, false, false, 0, 0, false,
|
||||||
|
CC_Default);
|
||||||
|
|
||||||
CurBlock->hasPrototype = true;
|
CurBlock->hasPrototype = true;
|
||||||
CurBlock->isVariadic = false;
|
CurBlock->isVariadic = false;
|
||||||
|
@ -6928,11 +6929,11 @@ Sema::OwningExprResult Sema::ActOnBlockStmtExpr(SourceLocation CaretLoc,
|
||||||
QualType BlockTy;
|
QualType BlockTy;
|
||||||
if (!BSI->hasPrototype)
|
if (!BSI->hasPrototype)
|
||||||
BlockTy = Context.getFunctionType(RetTy, 0, 0, false, 0, false, false, 0, 0,
|
BlockTy = Context.getFunctionType(RetTy, 0, 0, false, 0, false, false, 0, 0,
|
||||||
NoReturn);
|
NoReturn, CC_Default);
|
||||||
else
|
else
|
||||||
BlockTy = Context.getFunctionType(RetTy, ArgTypes.data(), ArgTypes.size(),
|
BlockTy = Context.getFunctionType(RetTy, ArgTypes.data(), ArgTypes.size(),
|
||||||
BSI->isVariadic, 0, false, false, 0, 0,
|
BSI->isVariadic, 0, false, false, 0, 0,
|
||||||
NoReturn);
|
NoReturn, CC_Default);
|
||||||
|
|
||||||
// FIXME: Check that return/parameter types are complete/non-abstract
|
// FIXME: Check that return/parameter types are complete/non-abstract
|
||||||
DiagnoseUnusedParameters(BSI->Params.begin(), BSI->Params.end());
|
DiagnoseUnusedParameters(BSI->Params.begin(), BSI->Params.end());
|
||||||
|
|
|
@ -1023,7 +1023,7 @@ void Sema::DeclareGlobalAllocationFunction(DeclarationName Name,
|
||||||
QualType FnType = Context.getFunctionType(Return, &Argument, 1, false, 0,
|
QualType FnType = Context.getFunctionType(Return, &Argument, 1, false, 0,
|
||||||
true, false,
|
true, false,
|
||||||
HasBadAllocExceptionSpec? 1 : 0,
|
HasBadAllocExceptionSpec? 1 : 0,
|
||||||
&BadAllocType);
|
&BadAllocType, false, CC_Default);
|
||||||
FunctionDecl *Alloc =
|
FunctionDecl *Alloc =
|
||||||
FunctionDecl::Create(Context, GlobalCtx, SourceLocation(), Name,
|
FunctionDecl::Create(Context, GlobalCtx, SourceLocation(), Name,
|
||||||
FnType, /*TInfo=*/0, FunctionDecl::None, false, true);
|
FnType, /*TInfo=*/0, FunctionDecl::None, false, true);
|
||||||
|
|
|
@ -544,7 +544,8 @@ static bool LookupDirect(Sema &S, LookupResult &R, const DeclContext *DC) {
|
||||||
0, 0, ConvProto->isVariadic(),
|
0, 0, ConvProto->isVariadic(),
|
||||||
ConvProto->getTypeQuals(),
|
ConvProto->getTypeQuals(),
|
||||||
false, false, 0, 0,
|
false, false, 0, 0,
|
||||||
ConvProto->getNoReturnAttr());
|
ConvProto->getNoReturnAttr(),
|
||||||
|
CC_Default);
|
||||||
|
|
||||||
// Perform template argument deduction against the type that we would
|
// Perform template argument deduction against the type that we would
|
||||||
// expect the function to have.
|
// expect the function to have.
|
||||||
|
|
|
@ -797,7 +797,7 @@ QualType Sema::BuildFunctionType(QualType T,
|
||||||
return QualType();
|
return QualType();
|
||||||
|
|
||||||
return Context.getFunctionType(T, ParamTypes, NumParamTypes, Variadic,
|
return Context.getFunctionType(T, ParamTypes, NumParamTypes, Variadic,
|
||||||
Quals);
|
Quals, false, false, 0, 0, false, CC_Default);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// \brief Build a member pointer type \c T Class::*.
|
/// \brief Build a member pointer type \c T Class::*.
|
||||||
|
@ -1132,7 +1132,8 @@ QualType Sema::GetTypeForDeclarator(Declarator &D, Scope *S,
|
||||||
T = Context.getFunctionType(T, NULL, 0, FTI.isVariadic, FTI.TypeQuals,
|
T = Context.getFunctionType(T, NULL, 0, FTI.isVariadic, FTI.TypeQuals,
|
||||||
FTI.hasExceptionSpec,
|
FTI.hasExceptionSpec,
|
||||||
FTI.hasAnyExceptionSpec,
|
FTI.hasAnyExceptionSpec,
|
||||||
Exceptions.size(), Exceptions.data());
|
Exceptions.size(), Exceptions.data(),
|
||||||
|
false, CC_Default);
|
||||||
} else if (FTI.isVariadic) {
|
} else if (FTI.isVariadic) {
|
||||||
// We allow a zero-parameter variadic function in C if the
|
// We allow a zero-parameter variadic function in C if the
|
||||||
// function is marked with the "overloadable"
|
// function is marked with the "overloadable"
|
||||||
|
@ -1148,7 +1149,8 @@ QualType Sema::GetTypeForDeclarator(Declarator &D, Scope *S,
|
||||||
|
|
||||||
if (!Overloadable)
|
if (!Overloadable)
|
||||||
Diag(FTI.getEllipsisLoc(), diag::err_ellipsis_first_arg);
|
Diag(FTI.getEllipsisLoc(), diag::err_ellipsis_first_arg);
|
||||||
T = Context.getFunctionType(T, NULL, 0, FTI.isVariadic, 0);
|
T = Context.getFunctionType(T, NULL, 0, FTI.isVariadic, 0,
|
||||||
|
false, false, 0, 0, false, CC_Default);
|
||||||
} else {
|
} else {
|
||||||
// Simple void foo(), where the incoming T is the result type.
|
// Simple void foo(), where the incoming T is the result type.
|
||||||
T = Context.getFunctionNoProtoType(T);
|
T = Context.getFunctionNoProtoType(T);
|
||||||
|
@ -1223,7 +1225,8 @@ QualType Sema::GetTypeForDeclarator(Declarator &D, Scope *S,
|
||||||
FTI.isVariadic, FTI.TypeQuals,
|
FTI.isVariadic, FTI.TypeQuals,
|
||||||
FTI.hasExceptionSpec,
|
FTI.hasExceptionSpec,
|
||||||
FTI.hasAnyExceptionSpec,
|
FTI.hasAnyExceptionSpec,
|
||||||
Exceptions.size(), Exceptions.data());
|
Exceptions.size(), Exceptions.data(),
|
||||||
|
false, CC_Default);
|
||||||
}
|
}
|
||||||
|
|
||||||
// For GCC compatibility, we allow attributes that apply only to
|
// For GCC compatibility, we allow attributes that apply only to
|
||||||
|
@ -1320,7 +1323,8 @@ QualType Sema::GetTypeForDeclarator(Declarator &D, Scope *S,
|
||||||
|
|
||||||
// Strip the cv-quals from the type.
|
// Strip the cv-quals from the type.
|
||||||
T = Context.getFunctionType(FnTy->getResultType(), FnTy->arg_type_begin(),
|
T = Context.getFunctionType(FnTy->getResultType(), FnTy->arg_type_begin(),
|
||||||
FnTy->getNumArgs(), FnTy->isVariadic(), 0);
|
FnTy->getNumArgs(), FnTy->isVariadic(), 0,
|
||||||
|
false, false, 0, 0, false, CC_Default);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue