Permit redeclarations of a builtin to specify calling convention.
authorErich Keane <erich.keane@intel.com>
Thu, 21 Mar 2019 13:30:56 +0000 (13:30 +0000)
committerErich Keane <erich.keane@intel.com>
Thu, 21 Mar 2019 13:30:56 +0000 (13:30 +0000)
commit505427cb2fe4b7d0290eabbf6785c2a3643ef637
tree6872c3a5969a07c10f291f9b564f53dbd4f7f15f
parentcbb726d0c5384c029196d4c7160fa91dc3b3f0da
Permit redeclarations of a builtin to specify calling convention.

After https://reviews.llvm.org/rL355317 we noticed that quite a decent
amount of code redeclares builtins (memcpy in particular, I believe
reduced from an MSVC header) with a calling convention specified.
This gets particularly troublesome when the user specifies a new
'default' calling convention on the command line.

When looking to add a diagnostic for this case, it was noticed that we
had 3 other diagnostics that differed only slightly.  This patch ALSO
unifies those under a 'select'.  Unfortunately, the order of words in
ONE of these diagnostics was reversed ("'thiscall' calling convention"
vs "calling convention 'thiscall'"), so this patch also standardizes on
the former.

Differential Revision: https://reviews.llvm.org/D59560

Change-Id: I79f99fe7c2301640755ffdd774b46eb44526bb22
llvm-svn: 356663
15 files changed:
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/include/clang/Sema/Sema.h
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/SemaDeclAttr.cpp
clang/lib/Sema/SemaType.cpp
clang/test/CodeGen/aarch64-vpcs.c
clang/test/Sema/callingconv-iamcu.c
clang/test/Sema/callingconv.c
clang/test/Sema/pr25786.c
clang/test/Sema/stdcall-fastcall-x64.c
clang/test/SemaCUDA/cuda-inherits-calling-conv.cu
clang/test/SemaCXX/borland-extensions.cpp
clang/test/SemaCXX/cxx11-gnu-attrs.cpp
clang/test/SemaCXX/virtual-override-x64.cpp
clang/test/SemaTemplate/instantiate-function-params.cpp