aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Divacky <rdivacky@freebsd.org>2011-08-05 16:37:22 +0000
committerRoman Divacky <rdivacky@freebsd.org>2011-08-05 16:37:22 +0000
commit8e68f1c8a2919ea83c2053731d6011074f1062e1 (patch)
tree0ba49911c7387d0ede5b49b80a3686dd149da89d
parentc268434b332bbe57950d977633369bf5822d9554 (diff)
Let attribute((cdecl)) and company override -mrtd default calling convention.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136971 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/AST/ASTContext.h2
-rw-r--r--lib/Sema/SemaType.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h
index 4e5e7888b4..0c6bc954a7 100644
--- a/include/clang/AST/ASTContext.h
+++ b/include/clang/AST/ASTContext.h
@@ -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;
}
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index 2f93642d2f..f429449acf 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -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)