[clang] [Clang] replace 'bitfield' with 'bit-field' for consistency (PR #117881)

via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 27 05:48:33 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-modules

Author: Oleksandr T. (a-tarasyuk)

<details>
<summary>Changes</summary>

Fixes #<!-- -->117711

---
Full diff: https://github.com/llvm/llvm-project/pull/117881.diff


4 Files Affected:

- (modified) clang/include/clang/Basic/DiagnosticASTKinds.td (+4-4) 
- (modified) clang/include/clang/Basic/DiagnosticSemaKinds.td (+1-1) 
- (modified) clang/test/Modules/compare-record.c (+8-8) 
- (modified) clang/test/Modules/odr_hash.cpp (+6-6) 


``````````diff
diff --git a/clang/include/clang/Basic/DiagnosticASTKinds.td b/clang/include/clang/Basic/DiagnosticASTKinds.td
index 6a658cf14356f5..f630698757c5fb 100644
--- a/clang/include/clang/Basic/DiagnosticASTKinds.td
+++ b/clang/include/clang/Basic/DiagnosticASTKinds.td
@@ -782,8 +782,8 @@ def err_module_odr_violation_field : Error<
   "%select{"
   "field %4|"
   "field %4 with type %5|"
-  "%select{non-|}5bitfield %4|"
-  "bitfield %4 with one width expression|"
+  "%select{non-|}5bit-field %4|"
+  "bit-field %4 with one width expression|"
   "%select{non-|}5mutable field %4|"
   "field %4 with %select{no|an}5 initializer|"
   "field %4 with an initializer"
@@ -793,8 +793,8 @@ def note_module_odr_violation_field : Note<
   "%select{"
   "field %3|"
   "field %3 with type %4|"
-  "%select{non-|}4bitfield %3|"
-  "bitfield %3 with different width expression|"
+  "%select{non-|}4bit-field %3|"
+  "bit-field %3 with different width expression|"
   "%select{non-|}4mutable field %3|"
   "field %3 with %select{no|an}4 initializer|"
   "field %3 with a different initializer"
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index 6ff24c2bc8faad..11dc8e7e2a26a9 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -6417,7 +6417,7 @@ def warn_signed_bitfield_enum_conversion : Warning<
   "enumerators of %1">,
   InGroup<BitFieldEnumConversion>, DefaultIgnore;
 def note_change_bitfield_sign : Note<
-  "consider making the bitfield type %select{unsigned|signed}0">;
+  "consider making the bit-field type %select{unsigned|signed}0">;
 
 def warn_missing_braces : Warning<
   "suggest braces around initialization of subobject">,
diff --git a/clang/test/Modules/compare-record.c b/clang/test/Modules/compare-record.c
index 60998696969e12..ef4a3a5b0e90db 100644
--- a/clang/test/Modules/compare-record.c
+++ b/clang/test/Modules/compare-record.c
@@ -226,17 +226,17 @@ struct CompareBitfieldWidthExpression {
 #else
 struct CompareMatchingBitfields compareMatchingBitfields;
 struct CompareBitfieldPresence1 compareBitfieldPresence1;
-// expected-error at first.h:* {{'CompareBitfieldPresence1' has different definitions in different modules; first difference is definition in module 'First.Hidden' found bitfield 'bitfieldPresence1'}}
-// expected-note at second.h:* {{but in 'Second' found non-bitfield 'bitfieldPresence1'}}
+// expected-error at first.h:* {{'CompareBitfieldPresence1' has different definitions in different modules; first difference is definition in module 'First.Hidden' found bit-field 'bitfieldPresence1'}}
+// expected-note at second.h:* {{but in 'Second' found non-bit-field 'bitfieldPresence1'}}
 struct CompareBitfieldPresence2 compareBitfieldPresence2;
-// expected-error at first.h:* {{'CompareBitfieldPresence2' has different definitions in different modules; first difference is definition in module 'First.Hidden' found non-bitfield 'bitfieldPresence2'}}
-// expected-note at second.h:* {{but in 'Second' found bitfield 'bitfieldPresence2'}}
+// expected-error at first.h:* {{'CompareBitfieldPresence2' has different definitions in different modules; first difference is definition in module 'First.Hidden' found non-bit-field 'bitfieldPresence2'}}
+// expected-note at second.h:* {{but in 'Second' found bit-field 'bitfieldPresence2'}}
 struct CompareBitfieldWidth compareBitfieldWidth;
-// expected-error at first.h:* {{'CompareBitfieldWidth' has different definitions in different modules; first difference is definition in module 'First.Hidden' found bitfield 'bitfieldWidth' with one width expression}}
-// expected-note at second.h:* {{but in 'Second' found bitfield 'bitfieldWidth' with different width expression}}
+// expected-error at first.h:* {{'CompareBitfieldWidth' has different definitions in different modules; first difference is definition in module 'First.Hidden' found bit-field 'bitfieldWidth' with one width expression}}
+// expected-note at second.h:* {{but in 'Second' found bit-field 'bitfieldWidth' with different width expression}}
 struct CompareBitfieldWidthExpression compareBitfieldWidthExpression;
-// expected-error at first.h:* {{'CompareBitfieldWidthExpression' has different definitions in different modules; first difference is definition in module 'First.Hidden' found bitfield 'bitfieldWidthExpression' with one width expression}}
-// expected-note at second.h:* {{but in 'Second' found bitfield 'bitfieldWidthExpression' with different width expressio}}
+// expected-error at first.h:* {{'CompareBitfieldWidthExpression' has different definitions in different modules; first difference is definition in module 'First.Hidden' found bit-field 'bitfieldWidthExpression' with one width expression}}
+// expected-note at second.h:* {{but in 'Second' found bit-field 'bitfieldWidthExpression' with different width expressio}}
 #endif
 
 #if defined(FIRST)
diff --git a/clang/test/Modules/odr_hash.cpp b/clang/test/Modules/odr_hash.cpp
index fa8b2c81ab46e1..f1de6b3d433ed7 100644
--- a/clang/test/Modules/odr_hash.cpp
+++ b/clang/test/Modules/odr_hash.cpp
@@ -264,8 +264,8 @@ struct S6 {
 };
 #else
 S6 s6;
-// expected-error at second.h:* {{'Field::S6' has different definitions in different modules; first difference is definition in module 'SecondModule' found bitfield 'x'}}
-// expected-note at first.h:* {{but in 'FirstModule' found non-bitfield 'x'}}
+// expected-error at second.h:* {{'Field::S6' has different definitions in different modules; first difference is definition in module 'SecondModule' found bit-field 'x'}}
+// expected-note at first.h:* {{but in 'FirstModule' found non-bit-field 'x'}}
 #endif
 
 #if defined(FIRST)
@@ -278,8 +278,8 @@ struct S7 {
 };
 #else
 S7 s7;
-// expected-error at second.h:* {{'Field::S7' has different definitions in different modules; first difference is definition in module 'SecondModule' found bitfield 'x' with one width expression}}
-// expected-note at first.h:* {{but in 'FirstModule' found bitfield 'x' with different width expression}}
+// expected-error at second.h:* {{'Field::S7' has different definitions in different modules; first difference is definition in module 'SecondModule' found bit-field 'x' with one width expression}}
+// expected-note at first.h:* {{but in 'FirstModule' found bit-field 'x' with different width expression}}
 #endif
 
 #if defined(FIRST)
@@ -292,8 +292,8 @@ struct S8 {
 };
 #else
 S8 s8;
-// expected-error at second.h:* {{'Field::S8' has different definitions in different modules; first difference is definition in module 'SecondModule' found bitfield 'x' with one width expression}}
-// expected-note at first.h:* {{but in 'FirstModule' found bitfield 'x' with different width expression}}
+// expected-error at second.h:* {{'Field::S8' has different definitions in different modules; first difference is definition in module 'SecondModule' found bit-field 'x' with one width expression}}
+// expected-note at first.h:* {{but in 'FirstModule' found bit-field 'x' with different width expression}}
 #endif
 
 #if defined(FIRST)

``````````

</details>


https://github.com/llvm/llvm-project/pull/117881


More information about the cfe-commits mailing list