[cfe-commits] r96895 - in /cfe/trunk: lib/Sema/SemaType.cpp test/Sema/callingconv.c

Charles Davis cdavis at mines.edu
Mon Feb 22 22:13:56 PST 2010


Author: cdavis
Date: Tue Feb 23 00:13:55 2010
New Revision: 96895

URL: http://llvm.org/viewvc/llvm-project?rev=96895&view=rev
Log:
When comparing two calling conventions after redeclaring a function, compare
the canonical calling conventions instead of comparing the raw calling
conventions directly. Fixes PR6361.

Modified:
    cfe/trunk/lib/Sema/SemaType.cpp
    cfe/trunk/test/Sema/callingconv.c

Modified: cfe/trunk/lib/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaType.cpp?rev=96895&r1=96894&r2=96895&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaType.cpp (original)
+++ cfe/trunk/lib/Sema/SemaType.cpp Tue Feb 23 00:13:55 2010
@@ -1755,7 +1755,8 @@
   }
 
   CallingConv CCOld = Fn->getCallConv();
-  if (CC == CCOld) return false;
+  if (S.Context.getCanonicalCallConv(CC) ==
+      S.Context.getCanonicalCallConv(CCOld)) return false;
 
   if (CCOld != CC_Default) {
     // Should we diagnose reapplications of the same convention?

Modified: cfe/trunk/test/Sema/callingconv.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/callingconv.c?rev=96895&r1=96894&r2=96895&view=diff
==============================================================================
--- cfe/trunk/test/Sema/callingconv.c (original)
+++ cfe/trunk/test/Sema/callingconv.c Tue Feb 23 00:13:55 2010
@@ -36,3 +36,7 @@
 typedef void (__attribute__((fastcall)) *Handler) (float *);
 Handler H = foo;
 
+// PR6361
+void ctest3();
+void __attribute__((cdecl)) ctest3() {}
+





More information about the cfe-commits mailing list