[cfe-commits] r136971 - in /cfe/trunk: include/clang/AST/ASTContext.h lib/Sema/SemaType.cpp

Roman Divacky rdivacky at freebsd.org
Fri Aug 5 09:37:22 PDT 2011


Author: rdivacky
Date: Fri Aug  5 11:37:22 2011
New Revision: 136971

URL: http://llvm.org/viewvc/llvm-project?rev=136971&view=rev
Log:
Let attribute((cdecl)) and company override -mrtd default calling convention.

Modified:
    cfe/trunk/include/clang/AST/ASTContext.h
    cfe/trunk/lib/Sema/SemaType.cpp

Modified: cfe/trunk/include/clang/AST/ASTContext.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTContext.h?rev=136971&r1=136970&r2=136971&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/ASTContext.h (original)
+++ cfe/trunk/include/clang/AST/ASTContext.h Fri Aug  5 11:37:22 2011
@@ -1256,7 +1256,7 @@
   /// \brief Retrieves the canonical representation of the given
   /// calling convention.
   CallingConv getCanonicalCallConv(CallingConv CC) const {
-    if (CC == CC_C)
+    if (!LangOpts.MRTD && CC == CC_C)
       return CC_Default;
     return CC;
   }

Modified: cfe/trunk/lib/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaType.cpp?rev=136971&r1=136970&r2=136971&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaType.cpp (original)
+++ cfe/trunk/lib/Sema/SemaType.cpp Fri Aug  5 11:37:22 2011
@@ -3482,7 +3482,7 @@
     return true;
   }
 
-  if (CCOld != CC_Default) {
+  if (CCOld != (S.LangOpts.MRTD ? CC_X86StdCall : CC_Default)) {
     // Should we diagnose reapplications of the same convention?
     S.Diag(attr.getLoc(), diag::err_attributes_are_not_compatible)
       << FunctionType::getNameForCallConv(CC)





More information about the cfe-commits mailing list