Skip to content

Commit 85d667f

Browse files
author
Sunil Srivastava
committed
Renamed and changed the wording of warn_cconv_ignored
As discussed in D64780 the wording of this warning message is being changed to say 'is not supported' instead of 'ignored', and the diag ID itself is being changed to warn_cconv_not_supported. llvm-svn: 366368
1 parent 0966dd0 commit 85d667f

17 files changed

+65
-65
lines changed

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2957,8 +2957,8 @@ def err_attribute_vecreturn_only_pod_record : Error<
29572957
def err_cconv_change : Error<
29582958
"function declared '%0' here was previously declared "
29592959
"%select{'%2'|without calling convention}1">;
2960-
def warn_cconv_ignored : Warning<
2961-
"%0 calling convention ignored %select{"
2960+
def warn_cconv_unsupported : Warning<
2961+
"%0 calling convention is not supported %select{"
29622962
// Use CallingConventionIgnoredReason Enum to specify these.
29632963
"for this target"
29642964
"|on variadic function"

clang/lib/Sema/SemaDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3165,7 +3165,7 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New, NamedDecl *&OldD,
31653165
// Calling Conventions on a Builtin aren't really useful and setting a
31663166
// default calling convention and cdecl'ing some builtin redeclarations is
31673167
// common, so warn and ignore the calling convention on the redeclaration.
3168-
Diag(New->getLocation(), diag::warn_cconv_ignored)
3168+
Diag(New->getLocation(), diag::warn_cconv_unsupported)
31693169
<< FunctionType::getNameForCallConv(NewTypeInfo.getCC())
31703170
<< (int)CallingConventionIgnoredReason::BuiltinFunction;
31713171
NewTypeInfo = NewTypeInfo.withCallingConv(OldTypeInfo.getCC());

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4669,7 +4669,7 @@ bool Sema::CheckCallingConvAttr(const ParsedAttr &Attrs, CallingConv &CC,
46694669
break;
46704670

46714671
case TargetInfo::CCCR_Warning: {
4672-
Diag(Attrs.getLoc(), diag::warn_cconv_ignored)
4672+
Diag(Attrs.getLoc(), diag::warn_cconv_unsupported)
46734673
<< Attrs << (int)CallingConventionIgnoredReason::ForThisTarget;
46744674

46754675
// This convention is not valid for the target. Use the default function or

clang/lib/Sema/SemaType.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7038,7 +7038,7 @@ static bool handleFunctionTypeAttr(TypeProcessingState &state, ParsedAttr &attr,
70387038
// stdcall and fastcall are ignored with a warning for GCC and MS
70397039
// compatibility.
70407040
if (CC == CC_X86StdCall || CC == CC_X86FastCall)
7041-
return S.Diag(attr.getLoc(), diag::warn_cconv_ignored)
7041+
return S.Diag(attr.getLoc(), diag::warn_cconv_unsupported)
70427042
<< FunctionType::getNameForCallConv(CC)
70437043
<< (int)Sema::CallingConventionIgnoredReason::VariadicFunction;
70447044

@@ -7103,7 +7103,7 @@ void Sema::adjustMemberFunctionCC(QualType &T, bool IsStatic, bool IsCtorOrDtor,
71037103
// Issue a warning on ignored calling convention -- except of __stdcall.
71047104
// Again, this is what MS compiler does.
71057105
if (CurCC != CC_X86StdCall)
7106-
Diag(Loc, diag::warn_cconv_ignored)
7106+
Diag(Loc, diag::warn_cconv_unsupported)
71077107
<< FunctionType::getNameForCallConv(CurCC)
71087108
<< (int)Sema::CallingConventionIgnoredReason::ConstructorDestructor;
71097109
// Default adjustment.

clang/test/CodeGen/aarch64-vpcs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %clang_cc1 -triple aarch64-linux-gnu -emit-llvm -x c++ -o - %s | FileCheck %s -check-prefix=CHECKCXX
33
// RUN: %clang_cc1 -triple i686-pc-linux-gnu -verify %s
44

5-
void __attribute__((aarch64_vector_pcs)) f(int *); // expected-warning {{'aarch64_vector_pcs' calling convention ignored for this target}}
5+
void __attribute__((aarch64_vector_pcs)) f(int *); // expected-warning {{'aarch64_vector_pcs' calling convention is not supported for this target}}
66

77
// CHECKC: define void @g(
88
// CHECKCXX: define void @_Z1gPi(
@@ -16,7 +16,7 @@ void g(int *a) {
1616
// CHECKC: declare aarch64_vector_pcs void @f(
1717
// CHECKCXX: declare aarch64_vector_pcs void @_Z1fPi
1818

19-
void __attribute__((aarch64_vector_pcs)) h(int *a){ // expected-warning {{'aarch64_vector_pcs' calling convention ignored for this target}}
19+
void __attribute__((aarch64_vector_pcs)) h(int *a){ // expected-warning {{'aarch64_vector_pcs' calling convention is not supported for this target}}
2020
// CHECKC: define aarch64_vector_pcs void @h(
2121
// CHECKCXX: define aarch64_vector_pcs void @_Z1hPi(
2222
f(a);

clang/test/Frontend/macro_defined_type.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ void Func() {
1717
// Added test for fix for P41835
1818
#define _LIBCPP_FLOAT_ABI __attribute__((pcs("aapcs")))
1919
struct A {
20-
_LIBCPP_FLOAT_ABI int operator()() throw(); // expected-warning{{'pcs' calling convention ignored for this target}}
20+
_LIBCPP_FLOAT_ABI int operator()() throw(); // expected-warning{{'pcs' calling convention is not supported for this target}}
2121
};

clang/test/Sema/callingconv-iamcu.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
// RUN: %clang_cc1 %s -fsyntax-only -triple i686-intel-elfiamcu -verify
22

3-
void __attribute__((fastcall)) foo(float *a) { // expected-warning {{'fastcall' calling convention ignored for this target}}
3+
void __attribute__((fastcall)) foo(float *a) { // expected-warning {{'fastcall' calling convention is not supported for this target}}
44
}
55

6-
void __attribute__((stdcall)) bar(float *a) { // expected-warning {{'stdcall' calling convention ignored for this target}}
6+
void __attribute__((stdcall)) bar(float *a) { // expected-warning {{'stdcall' calling convention is not supported for this target}}
77
}
88

99
void __attribute__((fastcall(1))) baz(float *a) { // expected-error {{'fastcall' attribute takes no arguments}}
1010
}
1111

12-
void __attribute__((fastcall)) test2(int a, ...) { // expected-warning {{'fastcall' calling convention ignored for this target}}
12+
void __attribute__((fastcall)) test2(int a, ...) { // expected-warning {{'fastcall' calling convention is not supported for this target}}
1313
}
14-
void __attribute__((stdcall)) test3(int a, ...) { // expected-warning {{'stdcall' calling convention ignored for this target}}
14+
void __attribute__((stdcall)) test3(int a, ...) { // expected-warning {{'stdcall' calling convention is not supported for this target}}
1515
}
16-
void __attribute__((thiscall)) test4(int a, ...) { // expected-warning {{'thiscall' calling convention ignored for this target}}
16+
void __attribute__((thiscall)) test4(int a, ...) { // expected-warning {{'thiscall' calling convention is not supported for this target}}
1717
}
1818

1919
void __attribute__((cdecl)) ctest0() {}
2020

2121
void __attribute__((cdecl(1))) ctest1(float x) {} // expected-error {{'cdecl' attribute takes no arguments}}
2222

23-
void (__attribute__((fastcall)) *pfoo)(float*) = foo; // expected-warning {{'fastcall' calling convention ignored for this target}}
23+
void (__attribute__((fastcall)) *pfoo)(float*) = foo; // expected-warning {{'fastcall' calling convention is not supported for this target}}
2424

25-
void (__attribute__((stdcall)) *pbar)(float*) = bar; // expected-warning {{'stdcall' calling convention ignored for this target}}
25+
void (__attribute__((stdcall)) *pbar)(float*) = bar; // expected-warning {{'stdcall' calling convention is not supported for this target}}
2626

2727
void (*pctest0)() = ctest0;
2828

2929
void ctest2() {}
3030
void (__attribute__((cdecl)) *pctest2)() = ctest2;
3131

32-
typedef void (__attribute__((fastcall)) *Handler) (float *); // expected-warning {{'fastcall' calling convention ignored for this target}}
32+
typedef void (__attribute__((fastcall)) *Handler) (float *); // expected-warning {{'fastcall' calling convention is not supported for this target}}
3333
Handler H = foo;
3434

3535
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 {{'pcs' attribute r
3838
// expected-error {{invalid PCS type}}
3939
int __attribute__((pcs(0))) pcs4(void); // expected-error {{'pcs' attribute requires a string}}
4040
/* These are ignored because the target is i386 and not ARM */
41-
int __attribute__((pcs("aapcs"))) pcs5(void); // expected-warning {{'pcs' calling convention ignored for this target}}
42-
int __attribute__((pcs("aapcs-vfp"))) pcs6(void); // expected-warning {{'pcs' calling convention ignored for this target}}
41+
int __attribute__((pcs("aapcs"))) pcs5(void); // expected-warning {{'pcs' calling convention is not supported for this target}}
42+
int __attribute__((pcs("aapcs-vfp"))) pcs6(void); // expected-warning {{'pcs' calling convention is not supported for this target}}
4343
int __attribute__((pcs("foo"))) pcs7(void); // expected-error {{invalid PCS type}}
4444

4545
void ctest3();
4646
void __attribute__((cdecl)) ctest3() {}
4747

48-
typedef __attribute__((stdcall)) void (*PROC)(); // expected-warning {{'stdcall' calling convention ignored for this target}}
48+
typedef __attribute__((stdcall)) void (*PROC)(); // expected-warning {{'stdcall' calling convention is not supported for this target}}
4949
PROC __attribute__((cdecl)) ctest4(const char *x) {}
5050

51-
void __attribute__((intel_ocl_bicc)) inteloclbifunc(float *a) {} // expected-warning {{'intel_ocl_bicc' calling convention ignored for this target}}
51+
void __attribute__((intel_ocl_bicc)) inteloclbifunc(float *a) {} // expected-warning {{'intel_ocl_bicc' calling convention is not supported for this target}}
5252

53-
struct type_test {} __attribute__((stdcall)); // expected-warning {{'stdcall' calling convention ignored for this target}} expected-warning {{'stdcall' attribute only applies to functions and methods}}
53+
struct type_test {} __attribute__((stdcall)); // expected-warning {{'stdcall' calling convention is not supported for this target}} expected-warning {{'stdcall' attribute only applies to functions and methods}}

clang/test/Sema/callingconv.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ void __attribute__((fastcall)) test0() {
1616
void __attribute__((fastcall)) test1(void) {
1717
}
1818

19-
void __attribute__((fastcall)) test2(int a, ...) { // expected-warning {{fastcall calling convention ignored on variadic function}}
19+
void __attribute__((fastcall)) test2(int a, ...) { // expected-warning {{fastcall calling convention is not supported on variadic function}}
2020
}
21-
void __attribute__((stdcall)) test3(int a, ...) { // expected-warning {{stdcall calling convention ignored on variadic function}}
21+
void __attribute__((stdcall)) test3(int a, ...) { // expected-warning {{stdcall calling convention is not supported on variadic function}}
2222
}
2323
void __attribute__((thiscall)) test4(int a, ...) { // expected-error {{variadic function cannot use thiscall calling convention}}
2424
}
@@ -47,11 +47,11 @@ int __attribute__((pcs(pcs1))) pcs3(void); // expected-error {{'pcs' attribute r
4747
// expected-error {{invalid PCS type}}
4848
int __attribute__((pcs(0))) pcs4(void); // expected-error {{'pcs' attribute requires a string}}
4949
/* These are ignored because the target is i386 and not ARM */
50-
int __attribute__((pcs("aapcs"))) pcs5(void); // expected-warning {{'pcs' calling convention ignored for this target}}
51-
int __attribute__((pcs("aapcs-vfp"))) pcs6(void); // expected-warning {{'pcs' calling convention ignored for this target}}
50+
int __attribute__((pcs("aapcs"))) pcs5(void); // expected-warning {{'pcs' calling convention is not supported for this target}}
51+
int __attribute__((pcs("aapcs-vfp"))) pcs6(void); // expected-warning {{'pcs' calling convention is not supported for this target}}
5252
int __attribute__((pcs("foo"))) pcs7(void); // expected-error {{invalid PCS type}}
5353

54-
int __attribute__((aarch64_vector_pcs)) aavpcs(void); // expected-warning {{'aarch64_vector_pcs' calling convention ignored for this target}}
54+
int __attribute__((aarch64_vector_pcs)) aavpcs(void); // expected-warning {{'aarch64_vector_pcs' calling convention is not supported for this target}}
5555

5656
// PR6361
5757
void ctest3();
@@ -69,4 +69,4 @@ void __attribute__((stdcall)) typedef_fun(int x) { } // expected-error {{functio
6969

7070
struct type_test {} __attribute__((stdcall)); // expected-warning {{'stdcall' attribute only applies to functions and methods}}
7171

72-
void __vectorcall __builtin_unreachable(); // expected-warning {{vectorcall calling convention ignored on builtin function}}
72+
void __vectorcall __builtin_unreachable(); // expected-warning {{vectorcall calling convention is not supported on builtin function}}

clang/test/Sema/mrtd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ void __attribute__((stdcall)) nonvariadic1(int a, int b, int c);
1212
void nonvariadic2(int a, int b, int c);
1313
void __attribute__((stdcall)) nonvariadic2(int a, int b, int c) { }
1414

15-
// expected-warning@+2 {{stdcall calling convention ignored on variadic function}}
15+
// expected-warning@+2 {{stdcall calling convention is not supported on variadic function}}
1616
void variadic(int a, ...);
1717
void __attribute__((stdcall)) variadic(int a, ...);
1818

@@ -33,6 +33,6 @@ __attribute__((cdecl)) extern void (*b)(int, ...);
3333
extern void (*c)(int, int);
3434
__attribute__((stdcall)) extern void (*c)(int, int);
3535

36-
// expected-warning@+2 {{stdcall calling convention ignored on variadic function}}
36+
// expected-warning@+2 {{stdcall calling convention is not supported on variadic function}}
3737
extern void (*d)(int, ...);
3838
__attribute__((stdcall)) extern void (*d)(int, ...);

clang/test/Sema/pr25786.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// RUN: %clang_cc1 -triple i686-unknown-linux-gnu -fsyntax-only -verify %s
33

44
#if TEST
5-
void (__attribute__((regparm(3), stdcall)) *pf) (); //expected-warning {{'stdcall' calling convention ignored for this target}}
6-
void (__attribute__((regparm(2), stdcall)) foo)(int a) { //expected-warning {{'stdcall' calling convention ignored for this target}}
5+
void (__attribute__((regparm(3), stdcall)) *pf) (); //expected-warning {{'stdcall' calling convention is not supported for this target}}
6+
void (__attribute__((regparm(2), stdcall)) foo)(int a) { //expected-warning {{'stdcall' calling convention is not supported for this target}}
77
}
88
#else
99
//expected-no-diagnostics

0 commit comments

Comments
 (0)