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

Reid Kleckner rnk at google.com
Mon Aug 26 17:34: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);
----------------
Richard Smith wrote:
>     FunctionType::ExtInfo EI(CC_C);
Done.

================
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;
----------------
Richard Smith wrote:
> This one should also have IsCXXMethod == true.
ditto

================
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);
+
----------------
Richard Smith wrote:
> Directly pass getCCForDeclaratorChunk as a constructor argument?
Done.

================
Comment at: lib/Sema/SemaLambda.cpp:822
@@ -820,3 +821,3 @@
   {
     FunctionProtoType::ExtProtoInfo ExtInfo = Proto->getExtProtoInfo();
     ExtInfo.TypeQuals = 0;
----------------
Richard Smith wrote:
> You need to override the calling convention to be a non-method CC here.
Done.  I can't test this because we can't compile lambdas yet due to mangling failures.

================
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;
----------------
Richard Smith wrote:
> IsCXXMethod should be 'true' here.
Done.


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



More information about the cfe-commits mailing list