summaryrefslogtreecommitdiff
path: root/lib/CodeGen/TargetInfo.cpp
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2013-08-27 23:08:25 +0000
committerReid Kleckner <reid@kleckner.net>2013-08-27 23:08:25 +0000
commitef072033876e295ec5d3402f8730a3ae358ad815 (patch)
treec13128c478d6635eb264c1f2f357a12a4ca53b58 /lib/CodeGen/TargetInfo.cpp
parenta7f6a94c1bae840c51351cd37cc247ae75f8e649 (diff)
downloadclang-ef072033876e295ec5d3402f8730a3ae358ad815.tar.gz
clang-ef072033876e295ec5d3402f8730a3ae358ad815.tar.bz2
clang-ef072033876e295ec5d3402f8730a3ae358ad815.tar.xz
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189412 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/TargetInfo.cpp')
-rw-r--r--lib/CodeGen/TargetInfo.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp
index 70fc8fed5d..b56684ba5c 100644
--- a/lib/CodeGen/TargetInfo.cpp
+++ b/lib/CodeGen/TargetInfo.cpp
@@ -1262,7 +1262,7 @@ public:
// that when AVX types are involved: the ABI explicitly states it is
// undefined, and it doesn't work in practice because of how the ABI
// defines varargs anyway.
- if (fnType->getCallConv() == CC_Default || fnType->getCallConv() == CC_C) {
+ if (fnType->getCallConv() == CC_C) {
bool HasAVXType = false;
for (CallArgList::const_iterator
it = args.begin(), ie = args.end(); it != ie; ++it) {