diff options
author | Erich Keane <erich.keane@intel.com> | 2019-03-21 13:30:56 +0000 |
---|---|---|
committer | Erich Keane <erich.keane@intel.com> | 2019-03-21 13:30:56 +0000 |
commit | f3fae3fc58401b1955106ac46249e9aff2749ab2 (patch) | |
tree | ad58652c37899261f075b381df75062fdeb7cd1d /lib/Sema/SemaDeclAttr.cpp | |
parent | e2755ead71aa45e2b4e65be9213db0a1fcea62fb (diff) | |
download | clang-f3fae3fc58401b1955106ac46249e9aff2749ab2.tar.gz |
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356663 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclAttr.cpp')
-rw-r--r-- | lib/Sema/SemaDeclAttr.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index e8a77b3dc2..dcccb4b468 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -4652,7 +4652,8 @@ bool Sema::CheckCallingConvAttr(const ParsedAttr &Attrs, CallingConv &CC, } if (A != TargetInfo::CCCR_OK) { if (A == TargetInfo::CCCR_Warning) - Diag(Attrs.getLoc(), diag::warn_cconv_ignored) << Attrs; + Diag(Attrs.getLoc(), diag::warn_cconv_ignored) + << Attrs << (int)CallingConventionIgnoredReason::ForThisTarget; // This convention is not valid for the target. Use the default function or // method calling convention. |