summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Frontend')
-rw-r--r--clang/lib/Frontend/PCHReader.cpp7
-rw-r--r--clang/lib/Frontend/PCHWriter.cpp5
-rw-r--r--clang/lib/Frontend/RewriteObjC.cpp51
3 files changed, 32 insertions, 31 deletions
diff --git a/clang/lib/Frontend/PCHReader.cpp b/clang/lib/Frontend/PCHReader.cpp
index 8fd81df098e..ceb7a6bf57b 100644
--- a/clang/lib/Frontend/PCHReader.cpp
+++ b/clang/lib/Frontend/PCHReader.cpp
@@ -2080,8 +2080,8 @@ QualType PCHReader::ReadTypeRecord(uint64_t Offset) {
return QualType();
}
QualType ResultType = GetType(Record[0]);
- return Context->getFunctionNoProtoType(ResultType, Record[1],
- (CallingConv)Record[2]);
+ FunctionType::ExtInfo Info(Record[1], (CallingConv)Record[2]);
+ return Context->getFunctionNoProtoType(ResultType, Info);
}
case pch::TYPE_FUNCTION_PROTO: {
@@ -2104,7 +2104,8 @@ QualType PCHReader::ReadTypeRecord(uint64_t Offset) {
return Context->getFunctionType(ResultType, ParamTypes.data(), NumParams,
isVariadic, Quals, hasExceptionSpec,
hasAnyExceptionSpec, NumExceptions,
- Exceptions.data(), NoReturn, CallConv);
+ Exceptions.data(),
+ FunctionType::ExtInfo(NoReturn, CallConv));
}
case pch::TYPE_UNRESOLVED_USING:
diff --git a/clang/lib/Frontend/PCHWriter.cpp b/clang/lib/Frontend/PCHWriter.cpp
index 6c2d1424c80..b4fbd17bd67 100644
--- a/clang/lib/Frontend/PCHWriter.cpp
+++ b/clang/lib/Frontend/PCHWriter.cpp
@@ -141,9 +141,10 @@ void PCHTypeWriter::VisitExtVectorType(const ExtVectorType *T) {
void PCHTypeWriter::VisitFunctionType(const FunctionType *T) {
Writer.AddTypeRef(T->getResultType(), Record);
- Record.push_back(T->getNoReturnAttr());
+ FunctionType::ExtInfo C = T->getExtInfo();
+ Record.push_back(C.getNoReturn());
// FIXME: need to stabilize encoding of calling convention...
- Record.push_back(T->getCallConv());
+ Record.push_back(C.getCC());
}
void PCHTypeWriter::VisitFunctionNoProtoType(const FunctionNoProtoType *T) {
diff --git a/clang/lib/Frontend/RewriteObjC.cpp b/clang/lib/Frontend/RewriteObjC.cpp
index 79aecceb70d..cba92987a3d 100644
--- a/clang/lib/Frontend/RewriteObjC.cpp
+++ b/clang/lib/Frontend/RewriteObjC.cpp
@@ -2262,8 +2262,8 @@ void RewriteObjC::SynthSelGetUidFunctionDecl() {
QualType getFuncType = Context->getFunctionType(Context->getObjCSelType(),
&ArgTys[0], ArgTys.size(),
false /*isVariadic*/, 0,
- false, false, 0, 0, false,
- CC_Default);
+ false, false, 0, 0,
+ FunctionType::ExtInfo());
SelGetUidFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
SourceLocation(),
SelGetUidIdent, getFuncType, 0,
@@ -2359,8 +2359,8 @@ void RewriteObjC::SynthSuperContructorFunctionDecl() {
QualType msgSendType = Context->getFunctionType(Context->getObjCIdType(),
&ArgTys[0], ArgTys.size(),
false, 0,
- false, false, 0, 0, false,
- CC_Default);
+ false, false, 0, 0,
+ FunctionType::ExtInfo());
SuperContructorFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
SourceLocation(),
msgSendIdent, msgSendType, 0,
@@ -2380,8 +2380,8 @@ void RewriteObjC::SynthMsgSendFunctionDecl() {
QualType msgSendType = Context->getFunctionType(Context->getObjCIdType(),
&ArgTys[0], ArgTys.size(),
true /*isVariadic*/, 0,
- false, false, 0, 0, false,
- CC_Default);
+ false, false, 0, 0,
+ FunctionType::ExtInfo());
MsgSendFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
SourceLocation(),
msgSendIdent, msgSendType, 0,
@@ -2404,8 +2404,8 @@ void RewriteObjC::SynthMsgSendSuperFunctionDecl() {
QualType msgSendType = Context->getFunctionType(Context->getObjCIdType(),
&ArgTys[0], ArgTys.size(),
true /*isVariadic*/, 0,
- false, false, 0, 0, false,
- CC_Default);
+ false, false, 0, 0,
+ FunctionType::ExtInfo());
MsgSendSuperFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
SourceLocation(),
msgSendIdent, msgSendType, 0,
@@ -2425,8 +2425,8 @@ void RewriteObjC::SynthMsgSendStretFunctionDecl() {
QualType msgSendType = Context->getFunctionType(Context->getObjCIdType(),
&ArgTys[0], ArgTys.size(),
true /*isVariadic*/, 0,
- false, false, 0, 0, false,
- CC_Default);
+ false, false, 0, 0,
+ FunctionType::ExtInfo());
MsgSendStretFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
SourceLocation(),
msgSendIdent, msgSendType, 0,
@@ -2451,8 +2451,8 @@ void RewriteObjC::SynthMsgSendSuperStretFunctionDecl() {
QualType msgSendType = Context->getFunctionType(Context->getObjCIdType(),
&ArgTys[0], ArgTys.size(),
true /*isVariadic*/, 0,
- false, false, 0, 0, false,
- CC_Default);
+ false, false, 0, 0,
+ FunctionType::ExtInfo());
MsgSendSuperStretFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
SourceLocation(),
msgSendIdent, msgSendType, 0,
@@ -2472,8 +2472,8 @@ void RewriteObjC::SynthMsgSendFpretFunctionDecl() {
QualType msgSendType = Context->getFunctionType(Context->DoubleTy,
&ArgTys[0], ArgTys.size(),
true /*isVariadic*/, 0,
- false, false, 0, 0, false,
- CC_Default);
+ false, false, 0, 0,
+ FunctionType::ExtInfo());
MsgSendFpretFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
SourceLocation(),
msgSendIdent, msgSendType, 0,
@@ -2488,8 +2488,8 @@ void RewriteObjC::SynthGetClassFunctionDecl() {
QualType getClassType = Context->getFunctionType(Context->getObjCIdType(),
&ArgTys[0], ArgTys.size(),
false /*isVariadic*/, 0,
- false, false, 0, 0, false,
- CC_Default);
+ false, false, 0, 0,
+ FunctionType::ExtInfo());
GetClassFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
SourceLocation(),
getClassIdent, getClassType, 0,
@@ -2505,8 +2505,8 @@ void RewriteObjC::SynthGetSuperClassFunctionDecl() {
QualType getClassType = Context->getFunctionType(Context->getObjCClassType(),
&ArgTys[0], ArgTys.size(),
false /*isVariadic*/, 0,
- false, false, 0, 0, false,
- CC_Default);
+ false, false, 0, 0,
+ FunctionType::ExtInfo());
GetSuperClassFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
SourceLocation(),
getSuperClassIdent, getClassType, 0,
@@ -2521,8 +2521,8 @@ void RewriteObjC::SynthGetMetaClassFunctionDecl() {
QualType getClassType = Context->getFunctionType(Context->getObjCIdType(),
&ArgTys[0], ArgTys.size(),
false /*isVariadic*/, 0,
- false, false, 0, 0, false,
- CC_Default);
+ false, false, 0, 0,
+ FunctionType::ExtInfo());
GetMetaClassFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
SourceLocation(),
getClassIdent, getClassType, 0,
@@ -2964,8 +2964,8 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp,
&ArgTypes[0], ArgTypes.size(),
// If we don't have a method decl, force a variadic cast.
Exp->getMethodDecl() ? Exp->getMethodDecl()->isVariadic() : true, 0,
- false, false, 0, 0, false,
- CC_Default);
+ false, false, 0, 0,
+ FunctionType::ExtInfo());
castType = Context->getPointerType(castType);
cast = NoTypeInfoCStyleCastExpr(Context, castType, CastExpr::CK_Unknown,
cast);
@@ -2995,8 +2995,8 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp,
castType = Context->getFunctionType(returnType,
&ArgTypes[0], ArgTypes.size(),
Exp->getMethodDecl() ? Exp->getMethodDecl()->isVariadic() : false, 0,
- false, false, 0, 0, false,
- CC_Default);
+ false, false, 0, 0,
+ FunctionType::ExtInfo());
castType = Context->getPointerType(castType);
cast = NoTypeInfoCStyleCastExpr(Context, castType, CastExpr::CK_Unknown,
cast);
@@ -4547,7 +4547,7 @@ Stmt *RewriteObjC::SynthesizeBlockCall(CallExpr *Exp, const Expr *BlockExp) {
QualType PtrToFuncCastType = Context->getFunctionType(Exp->getType(),
&ArgTypes[0], ArgTypes.size(), false/*no variadic*/, 0,
false, false, 0, 0,
- false, CC_Default);
+ FunctionType::ExtInfo());
PtrToFuncCastType = Context->getPointerType(PtrToFuncCastType);
@@ -5673,4 +5673,3 @@ void RewriteObjC::HandleTranslationUnit(ASTContext &C) {
}
OutFile->flush();
}
-
OpenPOWER on IntegriCloud