|
1 | 1 | Auto generated patch. Do not edit or delete it, even if empty.
|
| 2 | +diff -ruN --strip-trailing-cr a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp |
| 3 | +--- a/clang/lib/Sema/SemaInit.cpp |
| 4 | ++++ b/clang/lib/Sema/SemaInit.cpp |
| 5 | +@@ -4576,7 +4576,9 @@ |
| 6 | + if (!IsListInit && |
| 7 | + (Kind.getKind() == InitializationKind::IK_Default || |
| 8 | + Kind.getKind() == InitializationKind::IK_Direct) && |
| 9 | +- DestRecordDecl != nullptr && DestRecordDecl->isAggregate() && |
| 10 | ++ DestRecordDecl != nullptr && |
| 11 | ++ !(CtorDecl->isCopyOrMoveConstructor() && CtorDecl->isImplicit()) && |
| 12 | ++ DestRecordDecl->isAggregate() && |
| 13 | + DestRecordDecl->hasUninitializedExplicitInitFields()) { |
| 14 | + S.Diag(Kind.getLocation(), diag::warn_field_requires_explicit_init) |
| 15 | + << /* Var-in-Record */ 1 << DestRecordDecl; |
| 16 | +diff -ruN --strip-trailing-cr a/clang/test/SemaCXX/uninitialized.cpp b/clang/test/SemaCXX/uninitialized.cpp |
| 17 | +--- a/clang/test/SemaCXX/uninitialized.cpp |
| 18 | ++++ b/clang/test/SemaCXX/uninitialized.cpp |
| 19 | +@@ -1542,9 +1542,15 @@ |
| 20 | + }; |
| 21 | + }; |
| 22 | + |
| 23 | ++ struct CopyAndMove { |
| 24 | ++ CopyAndMove() = default; |
| 25 | ++ CopyAndMove(const CopyAndMove &) {} |
| 26 | ++ CopyAndMove(CopyAndMove &&) {} |
| 27 | ++ }; |
| 28 | + struct Embed { |
| 29 | + int embed1; // #FIELD_EMBED1 |
| 30 | + int embed2 [[clang::require_explicit_initialization]]; // #FIELD_EMBED2 |
| 31 | ++ CopyAndMove force_separate_move_ctor; |
| 32 | + }; |
| 33 | + struct EmbedDerived : Embed {}; |
| 34 | + struct F { |
| 35 | +@@ -1582,7 +1588,33 @@ |
| 36 | + F("___"), |
| 37 | + F("____") |
| 38 | + }; |
| 39 | +- (void)ctors; |
| 40 | ++ |
| 41 | ++ struct MoveOrCopy { |
| 42 | ++ Embed e; |
| 43 | ++ EmbedDerived ed; |
| 44 | ++ F f; |
| 45 | ++ // no-error |
| 46 | ++ MoveOrCopy(const MoveOrCopy &c) : e(c.e), ed(c.ed), f(c.f) {} |
| 47 | ++ // no-error |
| 48 | ++ MoveOrCopy(MoveOrCopy &&c) |
| 49 | ++ : e(std::move(c.e)), ed(std::move(c.ed)), f(std::move(c.f)) {} |
| 50 | ++ }; |
| 51 | ++ F copy1(ctors[0]); // no-error |
| 52 | ++ (void)copy1; |
| 53 | ++ F move1(std::move(ctors[0])); // no-error |
| 54 | ++ (void)move1; |
| 55 | ++ F copy2{ctors[0]}; // no-error |
| 56 | ++ (void)copy2; |
| 57 | ++ F move2{std::move(ctors[0])}; // no-error |
| 58 | ++ (void)move2; |
| 59 | ++ F copy3 = ctors[0]; // no-error |
| 60 | ++ (void)copy3; |
| 61 | ++ F move3 = std::move(ctors[0]); // no-error |
| 62 | ++ (void)move3; |
| 63 | ++ F copy4 = {ctors[0]}; // no-error |
| 64 | ++ (void)copy4; |
| 65 | ++ F move4 = {std::move(ctors[0])}; // no-error |
| 66 | ++ (void)move4; |
| 67 | + |
| 68 | + S::foo(S{1, 2, 3, 4}); |
| 69 | + S::foo(S{.s1 = 100, .s4 = 100}); |
| 70 | +diff -ruN --strip-trailing-cr a/llvm/include/llvm/DebugInfo/DWARF/DWARFVerifier.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFVerifier.h |
| 71 | +--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFVerifier.h |
| 72 | ++++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFVerifier.h |
| 73 | +@@ -30,15 +30,9 @@ |
| 74 | + class DataExtractor; |
| 75 | + struct DWARFSection; |
| 76 | + |
| 77 | +-struct AggregationData { |
| 78 | +- unsigned OverallCount; |
| 79 | +- std::map<std::string, unsigned> DetailedCounts; |
| 80 | +- AggregationData() = default; |
| 81 | +-}; |
| 82 | +- |
| 83 | + class OutputCategoryAggregator { |
| 84 | + private: |
| 85 | +- std::map<std::string, AggregationData> Aggregation; |
| 86 | ++ std::map<std::string, unsigned> Aggregation; |
| 87 | + bool IncludeDetail; |
| 88 | + |
| 89 | + public: |
| 90 | +@@ -46,13 +40,8 @@ |
| 91 | + : IncludeDetail(includeDetail) {} |
| 92 | + void ShowDetail(bool showDetail) { IncludeDetail = showDetail; } |
| 93 | + size_t GetNumCategories() const { return Aggregation.size(); } |
| 94 | +- void Report(StringRef category, std::function<void()> detailCallback); |
| 95 | +- void Report(StringRef category, StringRef sub_category, |
| 96 | +- std::function<void()> detailCallback); |
| 97 | ++ void Report(StringRef s, std::function<void()> detailCallback); |
| 98 | + void EnumerateResults(std::function<void(StringRef, unsigned)> handleCounts); |
| 99 | +- void EnumerateDetailedResultsFor( |
| 100 | +- StringRef category, |
| 101 | +- std::function<void(StringRef, unsigned)> handleCounts); |
| 102 | + }; |
| 103 | + |
| 104 | + /// A class that verifies DWARF debug information given a DWARF Context. |
| 105 | +diff -ruN --strip-trailing-cr a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp |
| 106 | +--- a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp |
| 107 | ++++ b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp |
| 108 | +@@ -1941,14 +1941,12 @@ |
| 109 | + if (none_of(NI.equal_range(Name), [&](const DWARFDebugNames::Entry &E) { |
| 110 | + return E.getDIEUnitOffset() == DieUnitOffset; |
| 111 | + })) { |
| 112 | +- ErrorCategory.Report( |
| 113 | +- "Name Index DIE entry missing name", |
| 114 | +- llvm::dwarf::TagString(Die.getTag()), [&]() { |
| 115 | +- error() << formatv( |
| 116 | +- "Name Index @ {0:x}: Entry for DIE @ {1:x} ({2}) with " |
| 117 | +- "name {3} missing.\n", |
| 118 | +- NI.getUnitOffset(), Die.getOffset(), Die.getTag(), Name); |
| 119 | +- }); |
| 120 | ++ ErrorCategory.Report("Name Index DIE entry missing name", [&]() { |
| 121 | ++ error() << formatv( |
| 122 | ++ "Name Index @ {0:x}: Entry for DIE @ {1:x} ({2}) with " |
| 123 | ++ "name {3} missing.\n", |
| 124 | ++ NI.getUnitOffset(), Die.getOffset(), Die.getTag(), Name); |
| 125 | ++ }); |
| 126 | + ++NumErrors; |
| 127 | + } |
| 128 | + } |
| 129 | +@@ -2170,35 +2168,15 @@ |
| 130 | + |
| 131 | + void OutputCategoryAggregator::Report( |
| 132 | + StringRef s, std::function<void(void)> detailCallback) { |
| 133 | +- this->Report(s, "", detailCallback); |
| 134 | +-} |
| 135 | +- |
| 136 | +-void OutputCategoryAggregator::Report( |
| 137 | +- StringRef category, StringRef sub_category, |
| 138 | +- std::function<void(void)> detailCallback) { |
| 139 | +- std::string category_str = std::string(category); |
| 140 | +- AggregationData *Agg = &Aggregation[category_str]; |
| 141 | +- Agg->OverallCount++; |
| 142 | +- if (!sub_category.empty()) { |
| 143 | +- Agg->DetailedCounts[std::string(sub_category)]++; |
| 144 | +- } |
| 145 | ++ Aggregation[std::string(s)]++; |
| 146 | + if (IncludeDetail) |
| 147 | + detailCallback(); |
| 148 | + } |
| 149 | + |
| 150 | + void OutputCategoryAggregator::EnumerateResults( |
| 151 | + std::function<void(StringRef, unsigned)> handleCounts) { |
| 152 | +- for (auto &&[name, aggData] : Aggregation) { |
| 153 | +- handleCounts(name, aggData.OverallCount); |
| 154 | +- } |
| 155 | +-} |
| 156 | +-void OutputCategoryAggregator::EnumerateDetailedResultsFor( |
| 157 | +- StringRef category, std::function<void(StringRef, unsigned)> handleCounts) { |
| 158 | +- auto Agg = Aggregation.find(std::string(category)); |
| 159 | +- if (Agg != Aggregation.end()) { |
| 160 | +- for (auto &&[name, count] : Agg->second.DetailedCounts) { |
| 161 | +- handleCounts(name, count); |
| 162 | +- } |
| 163 | ++ for (auto &&[name, count] : Aggregation) { |
| 164 | ++ handleCounts(name, count); |
| 165 | + } |
| 166 | + } |
| 167 | + |
| 168 | +@@ -2225,12 +2203,6 @@ |
| 169 | + ErrorCategory.EnumerateResults([&](StringRef Category, unsigned Count) { |
| 170 | + llvm::json::Object Val; |
| 171 | + Val.try_emplace("count", Count); |
| 172 | +- llvm::json::Object Details; |
| 173 | +- ErrorCategory.EnumerateDetailedResultsFor( |
| 174 | +- Category, [&](StringRef SubCategory, unsigned SubCount) { |
| 175 | +- Details.try_emplace(SubCategory, SubCount); |
| 176 | +- }); |
| 177 | +- Val.try_emplace("details", std::move(Details)); |
| 178 | + Categories.try_emplace(Category, std::move(Val)); |
| 179 | + ErrorCount += Count; |
| 180 | + }); |
| 181 | +diff -ruN --strip-trailing-cr a/llvm/test/tools/llvm-dwarfdump/X86/debug-names-verify-completeness-json-output.s b/llvm/test/tools/llvm-dwarfdump/X86/debug-names-verify-completeness-json-output.s |
| 182 | +--- a/llvm/test/tools/llvm-dwarfdump/X86/debug-names-verify-completeness-json-output.s |
| 183 | ++++ b/llvm/test/tools/llvm-dwarfdump/X86/debug-names-verify-completeness-json-output.s |
| 184 | +@@ -1,172 +0,0 @@ |
| 185 | +-# RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj -o - | not llvm-dwarfdump -verify --verify-json=%t.json - |
| 186 | +-# RUN: FileCheck %s --input-file %t.json |
| 187 | +- |
| 188 | +-# CHECK: {"error-categories":{"Name Index DIE entry missing name":{"count":10,"details":{"DW_TAG_inlined_subroutine":1,"DW_TAG_label":1,"DW_TAG_namespace":2,"DW_TAG_subprogram":2,"DW_TAG_variable":4}}},"error-count":10} |
| 189 | +-# CHECK-NOT: error: Name Index @ 0x0: Entry for DIE @ {{.*}} (DW_TAG_variable) with name var_block_addr missing. |
| 190 | +- |
| 191 | +- .section .debug_loc,"",@progbits |
| 192 | +-.Ldebug_loc0: |
| 193 | +- .quad 0 |
| 194 | +- .quad 1 |
| 195 | +- .short .Lloc0_end-.Lloc0_start # Loc expr size |
| 196 | +-.Lloc0_start: |
| 197 | +- .byte 3 # DW_OP_addr |
| 198 | +- .quad 0x47 |
| 199 | +-.Lloc0_end: |
| 200 | +- .quad 0 |
| 201 | +- .quad 0 |
| 202 | +- |
| 203 | +- .section .debug_abbrev,"",@progbits |
| 204 | +- .byte 1 # Abbreviation Code |
| 205 | +- .byte 17 # DW_TAG_compile_unit |
| 206 | +- .byte 1 # DW_CHILDREN_yes |
| 207 | +- .byte 37 # DW_AT_producer |
| 208 | +- .byte 8 # DW_FORM_string |
| 209 | +- .byte 17 # DW_AT_low_pc |
| 210 | +- .byte 1 # DW_FORM_addr |
| 211 | +- .byte 18 # DW_AT_high_pc |
| 212 | +- .byte 6 # DW_FORM_data4 |
| 213 | +- .byte 0 # EOM(1) |
| 214 | +- .byte 0 # EOM(2) |
| 215 | +- |
| 216 | +- .byte 2 # Abbreviation Code |
| 217 | +- .byte 52 # DW_TAG_variable |
| 218 | +- .byte 0 # DW_CHILDREN_no |
| 219 | +- .byte 3 # DW_AT_name |
| 220 | +- .byte 8 # DW_FORM_string |
| 221 | +- .byte 2 # DW_AT_location |
| 222 | +- .byte 24 # DW_FORM_exprloc |
| 223 | +- .byte 0 # EOM(1) |
| 224 | +- .byte 0 # EOM(2) |
| 225 | +- |
| 226 | +- .byte 3 # Abbreviation Code |
| 227 | +- .byte 46 # DW_TAG_subprogram |
| 228 | +- .byte 1 # DW_CHILDREN_yes |
| 229 | +- .byte 3 # DW_AT_name |
| 230 | +- .byte 8 # DW_FORM_string |
| 231 | +- .byte 110 # DW_AT_linkage_name |
| 232 | +- .byte 8 # DW_FORM_string |
| 233 | +- .byte 82 # DW_AT_entry_pc |
| 234 | +- .byte 1 # DW_FORM_addr |
| 235 | +- .byte 0 # EOM(1) |
| 236 | +- .byte 0 # EOM(2) |
| 237 | +- |
| 238 | +- .byte 4 # Abbreviation Code |
| 239 | +- .byte 57 # DW_TAG_namespace |
| 240 | +- .byte 1 # DW_CHILDREN_yes |
| 241 | +- .byte 3 # DW_AT_name |
| 242 | +- .byte 8 # DW_FORM_string |
| 243 | +- .byte 0 # EOM(1) |
| 244 | +- .byte 0 # EOM(2) |
| 245 | +- |
| 246 | +- .byte 5 # Abbreviation Code |
| 247 | +- .byte 52 # DW_TAG_variable |
| 248 | +- .byte 0 # DW_CHILDREN_no |
| 249 | +- .byte 3 # DW_AT_name |
| 250 | +- .byte 8 # DW_FORM_string |
| 251 | +- .byte 2 # DW_AT_location |
| 252 | +- .byte 23 # DW_FORM_sec_offset |
| 253 | +- .byte 0 # EOM(1) |
| 254 | +- .byte 0 # EOM(2) |
| 255 | +- |
| 256 | +- .byte 6 # Abbreviation Code |
| 257 | +- .byte 57 # DW_TAG_namespace |
| 258 | +- .byte 1 # DW_CHILDREN_yes |
| 259 | +- .byte 0 # EOM(1) |
| 260 | +- .byte 0 # EOM(2) |
| 261 | +- |
| 262 | +- .byte 7 # Abbreviation Code |
| 263 | +- .byte 29 # DW_TAG_inlined_subroutine |
| 264 | +- .byte 0 # DW_CHILDREN_no |
| 265 | +- .byte 3 # DW_AT_name |
| 266 | +- .byte 8 # DW_FORM_string |
| 267 | +- .byte 17 # DW_AT_low_pc |
| 268 | +- .byte 1 # DW_FORM_addr |
| 269 | +- .byte 18 # DW_AT_high_pc |
| 270 | +- .byte 1 # DW_FORM_addr |
| 271 | +- .byte 0 # EOM(1) |
| 272 | +- .byte 0 # EOM(2) |
| 273 | +- |
| 274 | +- .byte 8 # Abbreviation Code |
| 275 | +- .byte 10 # DW_TAG_label |
| 276 | +- .byte 0 # DW_CHILDREN_no |
| 277 | +- .byte 3 # DW_AT_name |
| 278 | +- .byte 8 # DW_FORM_string |
| 279 | +- .byte 82 # DW_AT_entry_pc |
| 280 | +- .byte 1 # DW_FORM_addr |
| 281 | +- .byte 0 # EOM(1) |
| 282 | +- .byte 0 # EOM(2) |
| 283 | +- |
| 284 | +- .byte 0 # EOM(3) |
| 285 | +- .section .debug_info,"",@progbits |
| 286 | +- |
| 287 | +-.Lcu_begin0: |
| 288 | +- .long .Lcu_end0-.Lcu_start0 # Length of Unit |
| 289 | +-.Lcu_start0: |
| 290 | +- .short 4 # DWARF version number |
| 291 | +- .long .debug_abbrev # Offset Into Abbrev. Section |
| 292 | +- .byte 8 # Address Size (in bytes) |
| 293 | +- .byte 1 # Abbrev [1] DW_TAG_compile_unit |
| 294 | +- .asciz "hand-written DWARF" # DW_AT_producer |
| 295 | +- .quad 0x0 # DW_AT_low_pc |
| 296 | +- .long 0x100 # DW_AT_high_pc |
| 297 | +- |
| 298 | +- .byte 4 # Abbrev [4] DW_TAG_namespace |
| 299 | +- .asciz "namesp" # DW_AT_name |
| 300 | +- .byte 2 # Abbrev [2] DW_TAG_variable |
| 301 | +- .asciz "var_block_addr" # DW_AT_name |
| 302 | +- .byte 9 # DW_AT_location |
| 303 | +- .byte 3 # DW_OP_addr |
| 304 | +- .quad 0x47 |
| 305 | +- .byte 0 # End Of Children Mark |
| 306 | +- |
| 307 | +- .byte 6 # Abbrev [6] DW_TAG_namespace |
| 308 | +- .byte 5 # Abbrev [5] DW_TAG_variable |
| 309 | +- .asciz "var_loc_addr" # DW_AT_name |
| 310 | +- .long .Ldebug_loc0 # DW_AT_location |
| 311 | +- .byte 0 # End Of Children Mark |
| 312 | +- |
| 313 | +- .byte 2 # Abbrev [2] DW_TAG_variable |
| 314 | +- .asciz "var_loc_tls" # DW_AT_name |
| 315 | +- .byte 1 # DW_AT_location |
| 316 | +- .byte 0x9b # DW_OP_form_tls_address |
| 317 | +- |
| 318 | +- .byte 2 # Abbrev [2] DW_TAG_variable |
| 319 | +- .asciz "var_loc_gnu_tls" # DW_AT_name |
| 320 | +- .byte 1 # DW_AT_location |
| 321 | +- .byte 0xe0 # DW_OP_GNU_push_tls_address |
| 322 | +- |
| 323 | +- .byte 3 # Abbrev [3] DW_TAG_subprogram |
| 324 | +- .asciz "fun_name" # DW_AT_name |
| 325 | +- .asciz "_Z8fun_name" # DW_AT_linkage_name |
| 326 | +- .quad 0x47 # DW_AT_entry_pc |
| 327 | +- .byte 7 # Abbrev [7] DW_TAG_inlined_subroutine |
| 328 | +- .asciz "fun_inline" # DW_AT_name |
| 329 | +- .quad 0x48 # DW_AT_low_pc |
| 330 | +- .quad 0x49 # DW_AT_high_pc |
| 331 | +- .byte 8 # Abbrev [8] DW_TAG_label |
| 332 | +- .asciz "label" # DW_AT_name |
| 333 | +- .quad 0x4a # DW_AT_entry_pc |
| 334 | +- .byte 0 # End Of Children Mark |
| 335 | +- |
| 336 | +- .byte 0 # End Of Children Mark |
| 337 | +-.Lcu_end0: |
| 338 | +- |
| 339 | +- .section .debug_names,"",@progbits |
| 340 | +- .long .Lnames_end0-.Lnames_start0 # Header: contribution length |
| 341 | +-.Lnames_start0: |
| 342 | +- .short 5 # Header: version |
| 343 | +- .short 0 # Header: padding |
| 344 | +- .long 1 # Header: compilation unit count |
| 345 | +- .long 0 # Header: local type unit count |
| 346 | +- .long 0 # Header: foreign type unit count |
| 347 | +- .long 0 # Header: bucket count |
| 348 | +- .long 0 # Header: name count |
| 349 | +- .long .Lnames_abbrev_end0-.Lnames_abbrev_start0 # Header: abbreviation table size |
| 350 | +- .long 0 # Header: augmentation length |
| 351 | +- .long .Lcu_begin0 # Compilation unit 0 |
| 352 | +-.Lnames_abbrev_start0: |
| 353 | +- .byte 0 # End of abbrev list |
| 354 | +-.Lnames_abbrev_end0: |
| 355 | +-.Lnames_entries0: |
| 356 | +-.Lnames_end0: |
| 357 | +diff -ruN --strip-trailing-cr a/llvm/test/Transforms/StructurizeCFG/simple-structurizecfg-crash.ll b/llvm/test/Transforms/StructurizeCFG/simple-structurizecfg-crash.ll |
| 358 | +--- a/llvm/test/Transforms/StructurizeCFG/simple-structurizecfg-crash.ll |
| 359 | ++++ b/llvm/test/Transforms/StructurizeCFG/simple-structurizecfg-crash.ll |
| 360 | +@@ -1,4 +1,5 @@ |
| 361 | + ; RUN: opt -S -passes=structurizecfg %s -o - |
| 362 | ++; REQUIRES: asserts |
| 363 | + ; XFAIL: * |
| 364 | + |
| 365 | + ; Issue tracking: https://github.com/llvm/llvm-project/issues/126534. |
0 commit comments