mirror of
https://github.com/intel/llvm.git
synced 2026-01-24 17:01:00 +08:00
Unpluralize -Wfoo-conversions warnings for consistency.
Err on the side of brevity and rename (while providing aliases for the original name) -Wbool-conversions, -Wint-conversions, and -Wvector-conversions for consistency with constant, literal, string, and sign conversion warnings. And name the diagnostic groups explicitly while I'm here rather than rewriting the string in the groups and sema td files. Curiously, vector-conversion is not under -Wconversion. Perhaps it should be. llvm-svn: 152776
This commit is contained in:
@@ -26,8 +26,12 @@ def : DiagGroup<"attributes">;
|
||||
def : DiagGroup<"bad-function-cast">;
|
||||
def Availability : DiagGroup<"availability">;
|
||||
def AutoImport : DiagGroup<"auto-import">;
|
||||
def BoolConversions : DiagGroup<"bool-conversions">;
|
||||
def IntConversions : DiagGroup<"int-conversions">;
|
||||
def ConstantConversion : DiagGroup<"constant-conversion">;
|
||||
def LiteralConversion : DiagGroup<"literal-conversion">;
|
||||
def StringConversion : DiagGroup<"string-conversion">;
|
||||
def SignConversion : DiagGroup<"sign-conversion">;
|
||||
def BoolConversion : DiagGroup<"bool-conversion">;
|
||||
def IntConversion : DiagGroup<"int-conversion">;
|
||||
def NullConversion : DiagGroup<"null-conversion">;
|
||||
def BuiltinRequiresHeader : DiagGroup<"builtin-requires-header">;
|
||||
def CXXCompat: DiagGroup<"c++-compat">;
|
||||
@@ -251,7 +255,7 @@ def SuperSubClassMismatch : DiagGroup<"super-class-method-mismatch">;
|
||||
def OverridingMethodMismatch : DiagGroup<"overriding-method-mismatch">;
|
||||
def : DiagGroup<"variadic-macros">;
|
||||
def VariadicMacros : DiagGroup<"variadic-macros">;
|
||||
def VectorConversions : DiagGroup<"vector-conversions">; // clang specific
|
||||
def VectorConversion : DiagGroup<"vector-conversion">; // clang specific
|
||||
def VexingParse : DiagGroup<"vexing-parse">;
|
||||
def VLA : DiagGroup<"vla">;
|
||||
def VolatileRegisterVar : DiagGroup<"volatile-register-var">;
|
||||
@@ -286,13 +290,13 @@ def Parentheses : DiagGroup<"parentheses",
|
||||
// - __null-to-integer conversion warnings are on by default
|
||||
def Conversion : DiagGroup<"conversion",
|
||||
[DiagGroup<"shorten-64-to-32">,
|
||||
DiagGroup<"constant-conversion">,
|
||||
DiagGroup<"literal-conversion">,
|
||||
DiagGroup<"string-conversion">,
|
||||
DiagGroup<"sign-conversion">,
|
||||
BoolConversions,
|
||||
ConstantConversion,
|
||||
LiteralConversion,
|
||||
StringConversion,
|
||||
SignConversion,
|
||||
BoolConversion,
|
||||
NullConversion,
|
||||
IntConversions]>,
|
||||
IntConversion]>,
|
||||
DiagCategory<"Value Conversion Issue">;
|
||||
|
||||
def Unused : DiagGroup<"unused",
|
||||
@@ -362,7 +366,12 @@ def : DiagGroup<"endif-labels", [ExtraTokens]>; // -Wendif-labels=-Wendif-tokens
|
||||
def : DiagGroup<"comments", [Comment]>; // -Wcomments = -Wcomment
|
||||
def : DiagGroup<"conversion-null",
|
||||
[NullConversion]>; // -Wconversion-null = -Wnull-conversion
|
||||
|
||||
def : DiagGroup<"bool-conversions",
|
||||
[BoolConversion]>; // -Wbool-conversions = -Wbool-conversion
|
||||
def : DiagGroup<"int-conversions",
|
||||
[IntConversion]>; // -Wint-conversions = -Wint-conversion
|
||||
def : DiagGroup<"vector-conversions",
|
||||
[VectorConversion]>; // -Wvector-conversions = -Wvector-conversion
|
||||
|
||||
// A warning group for warnings that we want to have on by default in clang,
|
||||
// but which aren't on by default in GCC.
|
||||
|
||||
@@ -1701,10 +1701,10 @@ def warn_impcast_float_integer : Warning<
|
||||
InGroup<DiagGroup<"conversion">>, DefaultIgnore;
|
||||
def warn_impcast_integer_sign : Warning<
|
||||
"implicit conversion changes signedness: %0 to %1">,
|
||||
InGroup<DiagGroup<"sign-conversion">>, DefaultIgnore;
|
||||
InGroup<SignConversion>, DefaultIgnore;
|
||||
def warn_impcast_integer_sign_conditional : Warning<
|
||||
"operand of ? changes signedness: %0 to %1">,
|
||||
InGroup<DiagGroup<"sign-conversion">>, DefaultIgnore;
|
||||
InGroup<SignConversion>, DefaultIgnore;
|
||||
def warn_impcast_integer_precision : Warning<
|
||||
"implicit conversion loses integer precision: %0 to %1">,
|
||||
InGroup<DiagGroup<"conversion">>, DefaultIgnore;
|
||||
@@ -1713,29 +1713,29 @@ def warn_impcast_integer_64_32 : Warning<
|
||||
InGroup<DiagGroup<"shorten-64-to-32">>, DefaultIgnore;
|
||||
def warn_impcast_integer_precision_constant : Warning<
|
||||
"implicit conversion from %2 to %3 changes value from %0 to %1">,
|
||||
InGroup<DiagGroup<"constant-conversion">>;
|
||||
InGroup<ConstantConversion>;
|
||||
def warn_impcast_bitfield_precision_constant : Warning<
|
||||
"implicit truncation from %2 to bitfield changes value from %0 to %1">,
|
||||
InGroup<DiagGroup<"constant-conversion">>;
|
||||
InGroup<ConstantConversion>;
|
||||
def warn_impcast_literal_float_to_integer : Warning<
|
||||
"implicit conversion turns literal floating-point number into integer: "
|
||||
"%0 to %1">,
|
||||
InGroup<DiagGroup<"literal-conversion">>, DefaultIgnore;
|
||||
InGroup<LiteralConversion>, DefaultIgnore;
|
||||
def warn_impcast_string_literal_to_bool : Warning<
|
||||
"implicit conversion turns string literal into bool: %0 to %1">,
|
||||
InGroup<DiagGroup<"string-conversion">>, DefaultIgnore;
|
||||
InGroup<StringConversion>, DefaultIgnore;
|
||||
def warn_impcast_different_enum_types : Warning<
|
||||
"implicit conversion from enumeration type %0 to different enumeration type "
|
||||
"%1">, InGroup<DiagGroup<"conversion">>;
|
||||
def warn_impcast_bool_to_null_pointer : Warning<
|
||||
"initialization of pointer of type %0 to null from a constant boolean "
|
||||
"expression">, InGroup<BoolConversions>;
|
||||
"expression">, InGroup<BoolConversion>;
|
||||
def warn_impcast_null_pointer_to_integer : Warning<
|
||||
"implicit conversion of NULL constant to integer">,
|
||||
InGroup<NullConversion>;
|
||||
def warn_impcast_function_to_bool : Warning<
|
||||
"address of function %q0 will always evaluate to 'true'">,
|
||||
InGroup<BoolConversions>;
|
||||
InGroup<BoolConversion>;
|
||||
def note_function_to_bool_silence : Note<
|
||||
"prefix with the address-of operator to silence this warning">;
|
||||
def note_function_to_bool_call : Note<
|
||||
@@ -4283,7 +4283,7 @@ def ext_typecheck_convert_pointer_int : ExtWarn<
|
||||
"take the address with &|"
|
||||
"remove *|"
|
||||
"remove &}3">,
|
||||
InGroup<IntConversions>;
|
||||
InGroup<IntConversion>;
|
||||
def ext_typecheck_convert_int_pointer : ExtWarn<
|
||||
"incompatible integer to pointer conversion "
|
||||
"%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
|
||||
@@ -4294,7 +4294,7 @@ def ext_typecheck_convert_int_pointer : ExtWarn<
|
||||
"take the address with &|"
|
||||
"remove *|"
|
||||
"remove &}3">,
|
||||
InGroup<IntConversions>;
|
||||
InGroup<IntConversion>;
|
||||
def ext_typecheck_convert_pointer_void_func : Extension<
|
||||
"%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
|
||||
" %0 "
|
||||
@@ -4339,7 +4339,7 @@ def warn_incompatible_vectors : Warning<
|
||||
" %0 "
|
||||
"%select{from|to parameter of type|from a function with result type|to type|"
|
||||
"with an expression of type|to parameter of type|to type}2 %1">,
|
||||
InGroup<VectorConversions>, DefaultIgnore;
|
||||
InGroup<VectorConversion>, DefaultIgnore;
|
||||
def err_int_to_block_pointer : Error<
|
||||
"invalid block pointer conversion "
|
||||
"%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-bool-conversions %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-bool-conversion %s
|
||||
|
||||
typedef __typeof__(((int*)0)-((int*)0)) ptrdiff_t;
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ void testMacro() {
|
||||
// CHECK: +-Range: {{.*[/\\]}}serialized-diags.c:22:3 {{.*[/\\]}}serialized-diags.c:22:6
|
||||
// CHECK: +-Range: {{.*[/\\]}}serialized-diags.c:20:15 {{.*[/\\]}}serialized-diags.c:20:16
|
||||
// CHECK: +-{{.*[/\\]}}serialized-diags.c:19:1: note: 'taz' declared here []
|
||||
// CHECK: {{.*[/\\]}}serialized-diags.h:5:7: warning: incompatible integer to pointer conversion initializing 'char *' with an expression of type 'int'; [-Wint-conversions]
|
||||
// CHECK: {{.*[/\\]}}serialized-diags.h:5:7: warning: incompatible integer to pointer conversion initializing 'char *' with an expression of type 'int'; [-Wint-conversion]
|
||||
// CHECK: Range: {{.*[/\\]}}serialized-diags.h:5:16 {{.*[/\\]}}serialized-diags.h:5:17
|
||||
// CHECK: +-{{.*[/\\]}}serialized-diags.c:26:10: note: in file included from {{.*[/\\]}}serialized-diags.c:26: []
|
||||
// CHECK: Number of diagnostics: 5
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %clang_cc1 -triple thumbv7-apple-darwin10 -target-cpu cortex-a8 -fsyntax-only -Wvector-conversions -ffreestanding -verify %s
|
||||
// RUN: %clang_cc1 -triple thumbv7-apple-darwin10 -target-cpu cortex-a8 -fsyntax-only -Wvector-conversion -ffreestanding -verify %s
|
||||
|
||||
#include <arm_neon.h>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %clang_cc1 %s -verify -fsyntax-only -Wvector-conversions
|
||||
// RUN: %clang_cc1 %s -verify -fsyntax-only -Wvector-conversion
|
||||
typedef unsigned int v2u __attribute__ ((vector_size (8)));
|
||||
typedef signed int v2s __attribute__ ((vector_size (8)));
|
||||
typedef signed int v1s __attribute__ ((vector_size (4)));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %clang_cc1 -fsyntax-only %s -verify -Wvector-conversions
|
||||
// RUN: %clang_cc1 -fsyntax-only %s -verify -Wvector-conversion
|
||||
|
||||
typedef long long t1 __attribute__ ((vector_size (8)));
|
||||
typedef char t2 __attribute__ ((vector_size (16)));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %clang_cc1 %s -verify -fsyntax-only -Wvector-conversions
|
||||
// RUN: %clang_cc1 %s -verify -fsyntax-only -Wvector-conversion
|
||||
typedef unsigned int v2u __attribute__ ((vector_size (8)));
|
||||
typedef int v2s __attribute__ ((vector_size (8)));
|
||||
typedef float v2f __attribute__ ((vector_size(8)));
|
||||
|
||||
Reference in New Issue
Block a user