[PATCH] Delete CC_Default and use the target default CC everywhere

Richard Smith richard at metafoo.co.uk
Fri Aug 23 16:38:21 PDT 2013



================
Comment at: lib/AST/ASTContext.cpp:7776-7777
@@ -7786,3 +7775,4 @@
 
   FunctionType::ExtInfo EI;
+  EI = EI.withCallingConv(CC_C);
   if (BuiltinInfo.isNoReturn(Id)) EI = EI.withNoReturn(true);
----------------
    FunctionType::ExtInfo EI(CC_C);

================
Comment at: lib/Sema/SemaLambda.cpp:829-830
@@ -829,1 +828,4 @@
+
+  FunctionProtoType::ExtProtoInfo ExtInfo(S.Context.getDefaultCallingConvention(
+      /*IsVariadic=*/false, /*IsCXXMethod=*/false));
   ExtInfo.TypeQuals = Qualifiers::Const;
----------------
IsCXXMethod should be 'true' here.

================
Comment at: lib/Sema/SemaLambda.cpp:822
@@ -820,3 +821,3 @@
   {
     FunctionProtoType::ExtProtoInfo ExtInfo = Proto->getExtProtoInfo();
     ExtInfo.TypeQuals = 0;
----------------
You need to override the calling convention to be a non-method CC here.

================
Comment at: lib/Sema/SemaLambda.cpp:900
@@ -898,1 +899,3 @@
+  FunctionProtoType::ExtProtoInfo ExtInfo(S.Context.getDefaultCallingConvention(
+      /*IsVariadic=*/false, /*IsCXXMethod=*/false));
   ExtInfo.TypeQuals = Qualifiers::Const;
----------------
This one should also have IsCXXMethod == true.

================
Comment at: lib/Sema/SemaType.cpp:2845-2847
@@ -2795,1 +2844,5 @@
 
+      FunctionType::ExtInfo EI;
+      CallingConv CC = getCCForDeclaratorChunk(S, D, FTI, chunkIndex);
+      EI = EI.withCallingConv(CC);
+
----------------
Directly pass getCCForDeclaratorChunk as a constructor argument?


http://llvm-reviews.chandlerc.com/D1231



More information about the cfe-commits mailing list