the big refactoring bits of PR3782.

This introduces FunctionType::ExtInfo to hold the calling convention and the
noreturn attribute. The next patch will extend it to include the regparm
attribute and fix the bug.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99920 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Frontend/RewriteObjC.cpp b/lib/Frontend/RewriteObjC.cpp
index 79aecce..cba9298 100644
--- a/lib/Frontend/RewriteObjC.cpp
+++ b/lib/Frontend/RewriteObjC.cpp
@@ -2262,8 +2262,8 @@
   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 @@
   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 @@
   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 @@
   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 @@
   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 @@
   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 @@
   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 @@
   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 @@
   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 @@
   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 @@
     &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 @@
     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 @@
   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 @@
   }
   OutFile->flush();
 }
-