Let attribute((cdecl)) and company override -mrtd default calling convention.

llvm-svn: 136971
This commit is contained in:
Roman Divacky 2011-08-05 16:37:22 +00:00
parent a70fbfd577
commit 30097b7c41
2 changed files with 2 additions and 2 deletions

View File

@ -1256,7 +1256,7 @@ public:
/// \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;
}

View File

@ -3482,7 +3482,7 @@ static bool handleFunctionTypeAttr(TypeProcessingState &state,
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)