diff options
author | Reid Kleckner <reid@kleckner.net> | 2013-08-27 23:08:25 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2013-08-27 23:08:25 +0000 |
commit | 78af0708b7d3b1d7a3189c39541c91cf9cb6d3f7 (patch) | |
tree | 390ae44b40f830581cf98ffae4be55c7480f9d0b /clang/lib/Basic | |
parent | 8f4524a7282aefe99ba42b92f9708c3d94232215 (diff) | |
download | bcm5719-llvm-78af0708b7d3b1d7a3189c39541c91cf9cb6d3f7.tar.gz bcm5719-llvm-78af0708b7d3b1d7a3189c39541c91cf9cb6d3f7.zip |
Delete CC_Default and use the target default CC everywhere
Summary:
Makes functions with implicit calling convention compatible with
function types with a matching explicit calling convention. This fixes
things like calls to qsort(), which has an explicit __cdecl attribute on
the comparator in Windows headers.
Clang will now infer the calling convention from the declarator. There
are two cases when the CC must be adjusted during redeclaration:
1. When defining a non-inline static method.
2. When redeclaring a function with an implicit or mismatched
convention.
Fixes PR13457, and allows clang to compile CommandLine.cpp for the
Microsoft C++ ABI.
Excellent test cases provided by Alexander Zinenko!
Reviewers: rsmith
Differential Revision: http://llvm-reviews.chandlerc.com/D1231
llvm-svn: 189412
Diffstat (limited to 'clang/lib/Basic')
-rw-r--r-- | clang/lib/Basic/Targets.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp index 84f8a347bda..f4c4226482d 100644 --- a/clang/lib/Basic/Targets.cpp +++ b/clang/lib/Basic/Targets.cpp @@ -3094,9 +3094,7 @@ public: } virtual CallingConvCheckResult checkCallingConvention(CallingConv CC) const { - return (CC == CC_Default || - CC == CC_C || - CC == CC_IntelOclBicc) ? CCCR_OK : CCCR_Warning; + return (CC == CC_C || CC == CC_IntelOclBicc) ? CCCR_OK : CCCR_Warning; } virtual CallingConv getDefaultCallingConv(CallingConvMethodType MT) const { |