r356663 - Permit redeclarations of a builtin to specify calling convention.
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 21 06:30:56 PDT 2019
Author: erichkeane
Date: Thu Mar 21 06:30:56 2019
New Revision: 356663
URL: http://llvm.org/viewvc/llvm-project?rev=356663&view=rev
Log:
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
Modified:
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/include/clang/Sema/Sema.h
cfe/trunk/lib/Sema/SemaDecl.cpp
cfe/trunk/lib/Sema/SemaDeclAttr.cpp
cfe/trunk/lib/Sema/SemaType.cpp
cfe/trunk/test/CodeGen/aarch64-vpcs.c
cfe/trunk/test/Sema/callingconv-iamcu.c
cfe/trunk/test/Sema/callingconv.c
cfe/trunk/test/Sema/pr25786.c
cfe/trunk/test/Sema/stdcall-fastcall-x64.c
cfe/trunk/test/SemaCUDA/cuda-inherits-calling-conv.cu
cfe/trunk/test/SemaCXX/borland-extensions.cpp
cfe/trunk/test/SemaCXX/cxx11-gnu-attrs.cpp
cfe/trunk/test/SemaCXX/virtual-override-x64.cpp
cfe/trunk/test/SemaTemplate/instantiate-function-params.cpp
Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=356663&r1=356662&r2=356663&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Thu Mar 21 06:30:56 2019
@@ -2923,7 +2923,14 @@ def err_cconv_change : Error<
"function declared '%0' here was previously declared "
"%select{'%2'|without calling convention}1">;
def warn_cconv_ignored : Warning<
- "calling convention %0 ignored for this target">, InGroup<IgnoredAttributes>;
+ "%0 calling convention ignored %select{"
+ // Use CallingConventionIgnoredReason Enum to specify these.
+ "for this target"
+ "|on variadic function"
+ "|on constructor/destructor"
+ "|on builtin function"
+ "}1">,
+ InGroup<IgnoredAttributes>;
def err_cconv_knr : Error<
"function with no prototype cannot use the %0 calling convention">;
def warn_cconv_knr : Warning<
@@ -2931,12 +2938,6 @@ def warn_cconv_knr : Warning<
InGroup<DiagGroup<"missing-prototype-for-cc">>;
def err_cconv_varargs : Error<
"variadic function cannot use %0 calling convention">;
-def warn_cconv_varargs : Warning<
- "%0 calling convention ignored on variadic function">,
- InGroup<IgnoredAttributes>;
-def warn_cconv_structors : Warning<
- "%0 calling convention ignored on constructor/destructor">,
- InGroup<IgnoredAttributes>;
def err_regparm_mismatch : Error<"function declared with regparm(%0) "
"attribute was previously declared "
"%plural{0:without the regparm|:with the regparm(%1)}1 attribute">;
Modified: cfe/trunk/include/clang/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=356663&r1=356662&r2=356663&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/Sema.h (original)
+++ cfe/trunk/include/clang/Sema/Sema.h Thu Mar 21 06:30:56 2019
@@ -11017,6 +11017,15 @@ public:
Expr *E,
llvm::function_ref<void(Expr *, RecordDecl *, FieldDecl *, CharUnits)>
Action);
+
+ /// Describes the reason a calling convention specification was ignored, used
+ /// for diagnostics.
+ enum class CallingConventionIgnoredReason {
+ ForThisTarget = 0,
+ VariadicFunction,
+ ConstructorDestructor,
+ BuiltinFunction
+ };
};
/// RAII object that enters a new expression evaluation context.
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=356663&r1=356662&r2=356663&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Thu Mar 21 06:30:56 2019
@@ -3136,6 +3136,15 @@ bool Sema::MergeFunctionDecl(FunctionDec
// there but not here.
NewTypeInfo = NewTypeInfo.withCallingConv(OldTypeInfo.getCC());
RequiresAdjustment = true;
+ } else if (New->getBuiltinID()) {
+ // Calling Conventions on a Builtin aren't really useful and setting a
+ // default calling convention and cdecl'ing some builtin redeclarations is
+ // common, so warn and ignore the calling convention on the redeclaration.
+ Diag(New->getLocation(), diag::warn_cconv_ignored)
+ << FunctionType::getNameForCallConv(NewTypeInfo.getCC())
+ << (int)CallingConventionIgnoredReason::BuiltinFunction;
+ NewTypeInfo = NewTypeInfo.withCallingConv(OldTypeInfo.getCC());
+ RequiresAdjustment = true;
} else {
// Calling conventions aren't compatible, so complain.
bool FirstCCExplicit = getCallingConvAttributedType(First->getType());
Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=356663&r1=356662&r2=356663&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Thu Mar 21 06:30:56 2019
@@ -4652,7 +4652,8 @@ bool Sema::CheckCallingConvAttr(const Pa
}
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.
Modified: cfe/trunk/lib/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaType.cpp?rev=356663&r1=356662&r2=356663&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaType.cpp (original)
+++ cfe/trunk/lib/Sema/SemaType.cpp Thu Mar 21 06:30:56 2019
@@ -6930,19 +6930,16 @@ static bool handleFunctionTypeAttr(TypeP
if (!supportsVariadicCall(CC)) {
const FunctionProtoType *FnP = dyn_cast<FunctionProtoType>(fn);
if (FnP && FnP->isVariadic()) {
- unsigned DiagID = diag::err_cconv_varargs;
-
// stdcall and fastcall are ignored with a warning for GCC and MS
// compatibility.
- bool IsInvalid = true;
- if (CC == CC_X86StdCall || CC == CC_X86FastCall) {
- DiagID = diag::warn_cconv_varargs;
- IsInvalid = false;
- }
-
- S.Diag(attr.getLoc(), DiagID) << FunctionType::getNameForCallConv(CC);
- if (IsInvalid) attr.setInvalid();
- return true;
+ if (CC == CC_X86StdCall || CC == CC_X86FastCall)
+ return S.Diag(attr.getLoc(), diag::warn_cconv_ignored)
+ << FunctionType::getNameForCallConv(CC)
+ << (int)Sema::CallingConventionIgnoredReason::VariadicFunction;
+
+ attr.setInvalid();
+ return S.Diag(attr.getLoc(), diag::err_cconv_varargs)
+ << FunctionType::getNameForCallConv(CC);
}
}
@@ -6997,8 +6994,9 @@ void Sema::adjustMemberFunctionCC(QualTy
// Issue a warning on ignored calling convention -- except of __stdcall.
// Again, this is what MS compiler does.
if (CurCC != CC_X86StdCall)
- Diag(Loc, diag::warn_cconv_structors)
- << FunctionType::getNameForCallConv(CurCC);
+ Diag(Loc, diag::warn_cconv_ignored)
+ << FunctionType::getNameForCallConv(CurCC)
+ << (int)Sema::CallingConventionIgnoredReason::ConstructorDestructor;
// Default adjustment.
} else {
// Only adjust types with the default convention. For example, on Windows
Modified: cfe/trunk/test/CodeGen/aarch64-vpcs.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/aarch64-vpcs.c?rev=356663&r1=356662&r2=356663&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/aarch64-vpcs.c (original)
+++ cfe/trunk/test/CodeGen/aarch64-vpcs.c Thu Mar 21 06:30:56 2019
@@ -2,7 +2,7 @@
// RUN: %clang_cc1 -triple aarch64-linux-gnu -emit-llvm -x c++ -o - %s | FileCheck %s -check-prefix=CHECKCXX
// RUN: %clang_cc1 -triple i686-pc-linux-gnu -verify %s
-void __attribute__((aarch64_vector_pcs)) f(int *); // expected-warning {{calling convention 'aarch64_vector_pcs' ignored for this target}}
+void __attribute__((aarch64_vector_pcs)) f(int *); // expected-warning {{'aarch64_vector_pcs' calling convention ignored for this target}}
// CHECKC: define void @g(
// CHECKCXX: define void @_Z1gPi(
@@ -16,7 +16,7 @@ void g(int *a) {
// CHECKC: declare aarch64_vector_pcs void @f(
// CHECKCXX: declare aarch64_vector_pcs void @_Z1fPi
-void __attribute__((aarch64_vector_pcs)) h(int *a){ // expected-warning {{calling convention 'aarch64_vector_pcs' ignored for this target}}
+void __attribute__((aarch64_vector_pcs)) h(int *a){ // expected-warning {{'aarch64_vector_pcs' calling convention ignored for this target}}
// CHECKC: define aarch64_vector_pcs void @h(
// CHECKCXX: define aarch64_vector_pcs void @_Z1hPi(
f(a);
Modified: cfe/trunk/test/Sema/callingconv-iamcu.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/callingconv-iamcu.c?rev=356663&r1=356662&r2=356663&view=diff
==============================================================================
--- cfe/trunk/test/Sema/callingconv-iamcu.c (original)
+++ cfe/trunk/test/Sema/callingconv-iamcu.c Thu Mar 21 06:30:56 2019
@@ -1,35 +1,35 @@
// RUN: %clang_cc1 %s -fsyntax-only -triple i686-intel-elfiamcu -verify
-void __attribute__((fastcall)) foo(float *a) { // expected-warning {{calling convention 'fastcall' ignored for this target}}
+void __attribute__((fastcall)) foo(float *a) { // expected-warning {{'fastcall' calling convention ignored for this target}}
}
-void __attribute__((stdcall)) bar(float *a) { // expected-warning {{calling convention 'stdcall' ignored for this target}}
+void __attribute__((stdcall)) bar(float *a) { // expected-warning {{'stdcall' calling convention ignored for this target}}
}
void __attribute__((fastcall(1))) baz(float *a) { // expected-error {{'fastcall' attribute takes no arguments}}
}
-void __attribute__((fastcall)) test2(int a, ...) { // expected-warning {{calling convention 'fastcall' ignored for this target}}
+void __attribute__((fastcall)) test2(int a, ...) { // expected-warning {{'fastcall' calling convention ignored for this target}}
}
-void __attribute__((stdcall)) test3(int a, ...) { // expected-warning {{calling convention 'stdcall' ignored for this target}}
+void __attribute__((stdcall)) test3(int a, ...) { // expected-warning {{'stdcall' calling convention ignored for this target}}
}
-void __attribute__((thiscall)) test4(int a, ...) { // expected-warning {{calling convention 'thiscall' ignored for this target}}
+void __attribute__((thiscall)) test4(int a, ...) { // expected-warning {{'thiscall' calling convention ignored for this target}}
}
void __attribute__((cdecl)) ctest0() {}
void __attribute__((cdecl(1))) ctest1(float x) {} // expected-error {{'cdecl' attribute takes no arguments}}
-void (__attribute__((fastcall)) *pfoo)(float*) = foo; // expected-warning {{calling convention 'fastcall' ignored for this target}}
+void (__attribute__((fastcall)) *pfoo)(float*) = foo; // expected-warning {{'fastcall' calling convention ignored for this target}}
-void (__attribute__((stdcall)) *pbar)(float*) = bar; // expected-warning {{calling convention 'stdcall' ignored for this target}}
+void (__attribute__((stdcall)) *pbar)(float*) = bar; // expected-warning {{'stdcall' calling convention ignored for this target}}
void (*pctest0)() = ctest0;
void ctest2() {}
void (__attribute__((cdecl)) *pctest2)() = ctest2;
-typedef void (__attribute__((fastcall)) *Handler) (float *); // expected-warning {{calling convention 'fastcall' ignored for this target}}
+typedef void (__attribute__((fastcall)) *Handler) (float *); // expected-warning {{'fastcall' calling convention ignored for this target}}
Handler H = foo;
int __attribute__((pcs("aapcs", "aapcs"))) pcs1(void); // expected-error {{'pcs' attribute takes one argument}}
@@ -38,16 +38,16 @@ int __attribute__((pcs(pcs1))) pcs3(void
// expected-error {{invalid PCS type}}
int __attribute__((pcs(0))) pcs4(void); // expected-error {{'pcs' attribute requires a string}}
/* These are ignored because the target is i386 and not ARM */
-int __attribute__((pcs("aapcs"))) pcs5(void); // expected-warning {{calling convention 'pcs' ignored for this target}}
-int __attribute__((pcs("aapcs-vfp"))) pcs6(void); // expected-warning {{calling convention 'pcs' ignored for this target}}
+int __attribute__((pcs("aapcs"))) pcs5(void); // expected-warning {{'pcs' calling convention ignored for this target}}
+int __attribute__((pcs("aapcs-vfp"))) pcs6(void); // expected-warning {{'pcs' calling convention ignored for this target}}
int __attribute__((pcs("foo"))) pcs7(void); // expected-error {{invalid PCS type}}
void ctest3();
void __attribute__((cdecl)) ctest3() {}
-typedef __attribute__((stdcall)) void (*PROC)(); // expected-warning {{calling convention 'stdcall' ignored for this target}}
+typedef __attribute__((stdcall)) void (*PROC)(); // expected-warning {{'stdcall' calling convention ignored for this target}}
PROC __attribute__((cdecl)) ctest4(const char *x) {}
-void __attribute__((intel_ocl_bicc)) inteloclbifunc(float *a) {} // expected-warning {{calling convention 'intel_ocl_bicc' ignored for this target}}
+void __attribute__((intel_ocl_bicc)) inteloclbifunc(float *a) {} // expected-warning {{'intel_ocl_bicc' calling convention ignored for this target}}
-struct type_test {} __attribute__((stdcall)); // expected-warning {{calling convention 'stdcall' ignored for this target}} expected-warning {{'stdcall' attribute only applies to functions and methods}}
+struct type_test {} __attribute__((stdcall)); // expected-warning {{'stdcall' calling convention ignored for this target}} expected-warning {{'stdcall' attribute only applies to functions and methods}}
Modified: cfe/trunk/test/Sema/callingconv.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/callingconv.c?rev=356663&r1=356662&r2=356663&view=diff
==============================================================================
--- cfe/trunk/test/Sema/callingconv.c (original)
+++ cfe/trunk/test/Sema/callingconv.c Thu Mar 21 06:30:56 2019
@@ -47,11 +47,11 @@ int __attribute__((pcs(pcs1))) pcs3(void
// expected-error {{invalid PCS type}}
int __attribute__((pcs(0))) pcs4(void); // expected-error {{'pcs' attribute requires a string}}
/* These are ignored because the target is i386 and not ARM */
-int __attribute__((pcs("aapcs"))) pcs5(void); // expected-warning {{calling convention 'pcs' ignored for this target}}
-int __attribute__((pcs("aapcs-vfp"))) pcs6(void); // expected-warning {{calling convention 'pcs' ignored for this target}}
+int __attribute__((pcs("aapcs"))) pcs5(void); // expected-warning {{'pcs' calling convention ignored for this target}}
+int __attribute__((pcs("aapcs-vfp"))) pcs6(void); // expected-warning {{'pcs' calling convention ignored for this target}}
int __attribute__((pcs("foo"))) pcs7(void); // expected-error {{invalid PCS type}}
-int __attribute__((aarch64_vector_pcs)) aavpcs(void); // expected-warning {{calling convention 'aarch64_vector_pcs' ignored for this target}}
+int __attribute__((aarch64_vector_pcs)) aavpcs(void); // expected-warning {{'aarch64_vector_pcs' calling convention ignored for this target}}
// PR6361
void ctest3();
@@ -68,3 +68,5 @@ typedef_fun_t typedef_fun; // expected-n
void __attribute__((stdcall)) typedef_fun(int x) { } // expected-error {{function declared 'stdcall' here was previously declared without calling convention}}
struct type_test {} __attribute__((stdcall)); // expected-warning {{'stdcall' attribute only applies to functions and methods}}
+
+void __vectorcall __builtin_unreachable(); // expected-warning {{vectorcall calling convention ignored on builtin function}}
Modified: cfe/trunk/test/Sema/pr25786.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/pr25786.c?rev=356663&r1=356662&r2=356663&view=diff
==============================================================================
--- cfe/trunk/test/Sema/pr25786.c (original)
+++ cfe/trunk/test/Sema/pr25786.c Thu Mar 21 06:30:56 2019
@@ -2,8 +2,8 @@
// RUN: %clang_cc1 -triple i686-unknown-linux-gnu -fsyntax-only -verify %s
#if TEST
-void (__attribute__((regparm(3), stdcall)) *pf) (); //expected-warning {{calling convention 'stdcall' ignored for this target}}
-void (__attribute__((regparm(2), stdcall)) foo)(int a) { //expected-warning {{calling convention 'stdcall' ignored for this target}}
+void (__attribute__((regparm(3), stdcall)) *pf) (); //expected-warning {{'stdcall' calling convention ignored for this target}}
+void (__attribute__((regparm(2), stdcall)) foo)(int a) { //expected-warning {{'stdcall' calling convention ignored for this target}}
}
#else
//expected-no-diagnostics
Modified: cfe/trunk/test/Sema/stdcall-fastcall-x64.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/stdcall-fastcall-x64.c?rev=356663&r1=356662&r2=356663&view=diff
==============================================================================
--- cfe/trunk/test/Sema/stdcall-fastcall-x64.c (original)
+++ cfe/trunk/test/Sema/stdcall-fastcall-x64.c Thu Mar 21 06:30:56 2019
@@ -5,16 +5,16 @@ int __attribute__((stdcall)) var1; // ex
int __attribute__((fastcall)) var2; // expected-warning{{'fastcall' only applies to function types; type here is 'int'}}
// Different CC qualifiers are not compatible
-void __attribute__((stdcall, fastcall)) foo3(void); // expected-warning{{calling convention 'stdcall' ignored for this target}} expected-warning {{calling convention 'fastcall' ignored for this target}}
-void __attribute__((stdcall)) foo4(); // expected-warning{{calling convention 'stdcall' ignored for this target}}
-void __attribute__((fastcall)) foo4(void); // expected-warning {{calling convention 'fastcall' ignored for this target}}
+void __attribute__((stdcall, fastcall)) foo3(void); // expected-warning{{'stdcall' calling convention ignored for this target}} expected-warning {{'fastcall' calling convention ignored for this target}}
+void __attribute__((stdcall)) foo4(); // expected-warning{{'stdcall' calling convention ignored for this target}}
+void __attribute__((fastcall)) foo4(void); // expected-warning {{'fastcall' calling convention ignored for this target}}
// rdar://8876096
-void rdar8876096foo1(int i, int j) __attribute__((fastcall, cdecl)); // expected-warning{{calling convention 'fastcall' ignored for this target}}
-void rdar8876096foo2(int i, int j) __attribute__((fastcall, stdcall)); // expected-warning{{calling convention 'stdcall' ignored for this target}} expected-warning {{calling convention 'fastcall' ignored for this target}}
-void rdar8876096foo3(int i, int j) __attribute__((fastcall, regparm(2))); // expected-warning {{calling convention 'fastcall' ignored for this target}}
-void rdar8876096foo4(int i, int j) __attribute__((stdcall, cdecl)); // expected-warning{{calling convention 'stdcall' ignored for this target}}
-void rdar8876096foo5(int i, int j) __attribute__((stdcall, fastcall)); // expected-warning{{calling convention 'stdcall' ignored for this target}} expected-warning {{calling convention 'fastcall' ignored for this target}}
-void rdar8876096foo6(int i, int j) __attribute__((cdecl, fastcall)); // expected-warning {{calling convention 'fastcall' ignored for this target}}
-void rdar8876096foo7(int i, int j) __attribute__((cdecl, stdcall)); // expected-warning{{calling convention 'stdcall' ignored for this target}}
-void rdar8876096foo8(int i, int j) __attribute__((regparm(2), fastcall)); // expected-warning {{calling convention 'fastcall' ignored for this target}}
+void rdar8876096foo1(int i, int j) __attribute__((fastcall, cdecl)); // expected-warning{{'fastcall' calling convention ignored for this target}}
+void rdar8876096foo2(int i, int j) __attribute__((fastcall, stdcall)); // expected-warning{{'stdcall' calling convention ignored for this target}} expected-warning {{'fastcall' calling convention ignored for this target}}
+void rdar8876096foo3(int i, int j) __attribute__((fastcall, regparm(2))); // expected-warning {{'fastcall' calling convention ignored for this target}}
+void rdar8876096foo4(int i, int j) __attribute__((stdcall, cdecl)); // expected-warning{{'stdcall' calling convention ignored for this target}}
+void rdar8876096foo5(int i, int j) __attribute__((stdcall, fastcall)); // expected-warning{{'stdcall' calling convention ignored for this target}} expected-warning {{'fastcall' calling convention ignored for this target}}
+void rdar8876096foo6(int i, int j) __attribute__((cdecl, fastcall)); // expected-warning {{'fastcall' calling convention ignored for this target}}
+void rdar8876096foo7(int i, int j) __attribute__((cdecl, stdcall)); // expected-warning{{'stdcall' calling convention ignored for this target}}
+void rdar8876096foo8(int i, int j) __attribute__((regparm(2), fastcall)); // expected-warning {{'fastcall' calling convention ignored for this target}}
Modified: cfe/trunk/test/SemaCUDA/cuda-inherits-calling-conv.cu
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCUDA/cuda-inherits-calling-conv.cu?rev=356663&r1=356662&r2=356663&view=diff
==============================================================================
--- cfe/trunk/test/SemaCUDA/cuda-inherits-calling-conv.cu (original)
+++ cfe/trunk/test/SemaCUDA/cuda-inherits-calling-conv.cu Thu Mar 21 06:30:56 2019
@@ -24,7 +24,7 @@ struct Foo<T()> {};
// expected-no-diagnostics
#else
// expected-error at +4 {{redefinition of 'Foo}}
-// expected-warning at +3 {{calling convention '__fastcall' ignored}}
+// expected-warning at +3 {{'__fastcall' calling convention ignored}}
#endif
template <class T>
struct Foo<T __fastcall()> {};
Modified: cfe/trunk/test/SemaCXX/borland-extensions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/borland-extensions.cpp?rev=356663&r1=356662&r2=356663&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/borland-extensions.cpp (original)
+++ cfe/trunk/test/SemaCXX/borland-extensions.cpp Thu Mar 21 06:30:56 2019
@@ -7,21 +7,21 @@
int dummy_function() { return 0; }
// 2. test __pascal
-// expected-warning at +1 {{calling convention '_pascal' ignored for this target}}
+// expected-warning at +1 {{'_pascal' calling convention ignored for this target}}
int _pascal f2();
-// expected-warning at +1 {{calling convention '__pascal' ignored for this target}}
+// expected-warning at +1 {{'__pascal' calling convention ignored for this target}}
float __pascal gi2(int, int);
-// expected-warning at +1 {{calling convention '__pascal' ignored for this target}}
+// expected-warning at +1 {{'__pascal' calling convention ignored for this target}}
template<typename T> T g2(T (__pascal * const )(int, int)) { return 0; }
struct M {
- // expected-warning at +1 {{calling convention '__pascal' ignored for this target}}
+ // expected-warning at +1 {{'__pascal' calling convention ignored for this target}}
int __pascal addP();
- // expected-warning at +1 {{calling convention '__pascal' ignored for this target}}
+ // expected-warning at +1 {{'__pascal' calling convention ignored for this target}}
float __pascal subtractP();
};
-// expected-warning at +1 {{calling convention '__pascal' ignored for this target}}
+// expected-warning at +1 {{'__pascal' calling convention ignored for this target}}
template<typename T> int h2(T (__pascal M::* const )()) { return 0; }
void m2() {
int i; float f;
@@ -34,9 +34,9 @@ void m2() {
// 3. test other calling conventions
int _cdecl fa3();
-// expected-warning at +1 {{calling convention '_fastcall' ignored for this target}}
+// expected-warning at +1 {{'_fastcall' calling convention ignored for this target}}
int _fastcall fc3();
-// expected-warning at +1 {{calling convention '_stdcall' ignored for this target}}
+// expected-warning at +1 {{'_stdcall' calling convention ignored for this target}}
int _stdcall fd3();
// 4. test __uuidof()
Modified: cfe/trunk/test/SemaCXX/cxx11-gnu-attrs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/cxx11-gnu-attrs.cpp?rev=356663&r1=356662&r2=356663&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/cxx11-gnu-attrs.cpp (original)
+++ cfe/trunk/test/SemaCXX/cxx11-gnu-attrs.cpp Thu Mar 21 06:30:56 2019
@@ -9,18 +9,18 @@ int [[gnu::unused]] attr_on_type;
int *[[gnu::unused]] attr_on_ptr;
// expected-warning at -1 {{attribute 'unused' ignored, because it cannot be applied to a type}}
[[gnu::fastcall]] void pr17424_1();
-// expected-warning at -1 {{calling convention 'fastcall' ignored for this target}}
+// expected-warning at -1 {{'fastcall' calling convention ignored for this target}}
[[gnu::fastcall]] [[gnu::stdcall]] void pr17424_2();
-// expected-warning at -1 {{calling convention 'fastcall' ignored for this target}}
-// expected-warning at -2 {{calling convention 'stdcall' ignored for this target}}
+// expected-warning at -1 {{'fastcall' calling convention ignored for this target}}
+// expected-warning at -2 {{'stdcall' calling convention ignored for this target}}
[[gnu::fastcall]] __stdcall void pr17424_3();
-// expected-warning at -1 {{calling convention 'fastcall' ignored for this target}}
-// expected-warning at -2 {{calling convention '__stdcall' ignored for this target}}
+// expected-warning at -1 {{'fastcall' calling convention ignored for this target}}
+// expected-warning at -2 {{'__stdcall' calling convention ignored for this target}}
[[gnu::fastcall]] void pr17424_4() [[gnu::stdcall]];
-// expected-warning at -1 {{calling convention 'fastcall' ignored for this target}}
-// expected-warning at -2 {{calling convention 'stdcall' ignored for this target}}
+// expected-warning at -1 {{'fastcall' calling convention ignored for this target}}
+// expected-warning at -2 {{'stdcall' calling convention ignored for this target}}
void pr17424_5 [[gnu::fastcall]]();
-// expected-warning at -1 {{calling convention 'fastcall' ignored for this target}}
+// expected-warning at -1 {{'fastcall' calling convention ignored for this target}}
// Valid cases.
Modified: cfe/trunk/test/SemaCXX/virtual-override-x64.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/virtual-override-x64.cpp?rev=356663&r1=356662&r2=356663&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/virtual-override-x64.cpp (original)
+++ cfe/trunk/test/SemaCXX/virtual-override-x64.cpp Thu Mar 21 06:30:56 2019
@@ -6,7 +6,7 @@
namespace PR14339 {
class A {
public:
- virtual void __attribute__((thiscall)) f(); // expected-warning {{calling convention 'thiscall' ignored for this target}}
+ virtual void __attribute__((thiscall)) f(); // expected-warning {{'thiscall' calling convention ignored for this target}}
};
class B : public A {
@@ -16,7 +16,7 @@ namespace PR14339 {
class C : public A {
public:
- void __attribute__((thiscall)) f(); // expected-warning {{calling convention 'thiscall' ignored for this target}}
+ void __attribute__((thiscall)) f(); // expected-warning {{'thiscall' calling convention ignored for this target}}
};
class D : public A {
@@ -26,7 +26,7 @@ namespace PR14339 {
class E {
public:
- virtual void __attribute__((stdcall)) g(); // expected-warning {{calling convention 'stdcall' ignored for this target}}
+ virtual void __attribute__((stdcall)) g(); // expected-warning {{'stdcall' calling convention ignored for this target}}
};
class F : public E {
Modified: cfe/trunk/test/SemaTemplate/instantiate-function-params.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/instantiate-function-params.cpp?rev=356663&r1=356662&r2=356663&view=diff
==============================================================================
--- cfe/trunk/test/SemaTemplate/instantiate-function-params.cpp (original)
+++ cfe/trunk/test/SemaTemplate/instantiate-function-params.cpp Thu Mar 21 06:30:56 2019
@@ -88,7 +88,7 @@ namespace InstantiateFunctionTypedef {
__attribute__((stdcall)) functype stdfunc1;
stdfunctype stdfunc2;
- __attribute__((pcs("aapcs"))) functype pcsfunc; // expected-warning {{calling convention 'pcs' ignored for this target}}
+ __attribute__((pcs("aapcs"))) functype pcsfunc; // expected-warning {{'pcs' calling convention ignored for this target}}
};
void f(X<int> x) {
More information about the cfe-commits
mailing list