-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate LLVM at llvm/llvm-project@ab93bd6959d6
Updates LLVM usage to match [ab93bd6959d6](llvm/llvm-project@ab93bd6959d6) PiperOrigin-RevId: 725980705
- Loading branch information
1 parent
35f8e22
commit e5c2a1b
Showing
2 changed files
with
2 additions
and
366 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,365 +1 @@ | ||
Auto generated patch. Do not edit or delete it, even if empty. | ||
diff -ruN --strip-trailing-cr a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp | ||
--- a/clang/lib/Sema/SemaInit.cpp | ||
+++ b/clang/lib/Sema/SemaInit.cpp | ||
@@ -4576,7 +4576,9 @@ | ||
if (!IsListInit && | ||
(Kind.getKind() == InitializationKind::IK_Default || | ||
Kind.getKind() == InitializationKind::IK_Direct) && | ||
- DestRecordDecl != nullptr && DestRecordDecl->isAggregate() && | ||
+ DestRecordDecl != nullptr && | ||
+ !(CtorDecl->isCopyOrMoveConstructor() && CtorDecl->isImplicit()) && | ||
+ DestRecordDecl->isAggregate() && | ||
DestRecordDecl->hasUninitializedExplicitInitFields()) { | ||
S.Diag(Kind.getLocation(), diag::warn_field_requires_explicit_init) | ||
<< /* Var-in-Record */ 1 << DestRecordDecl; | ||
diff -ruN --strip-trailing-cr a/clang/test/SemaCXX/uninitialized.cpp b/clang/test/SemaCXX/uninitialized.cpp | ||
--- a/clang/test/SemaCXX/uninitialized.cpp | ||
+++ b/clang/test/SemaCXX/uninitialized.cpp | ||
@@ -1542,9 +1542,15 @@ | ||
}; | ||
}; | ||
|
||
+ struct CopyAndMove { | ||
+ CopyAndMove() = default; | ||
+ CopyAndMove(const CopyAndMove &) {} | ||
+ CopyAndMove(CopyAndMove &&) {} | ||
+ }; | ||
struct Embed { | ||
int embed1; // #FIELD_EMBED1 | ||
int embed2 [[clang::require_explicit_initialization]]; // #FIELD_EMBED2 | ||
+ CopyAndMove force_separate_move_ctor; | ||
}; | ||
struct EmbedDerived : Embed {}; | ||
struct F { | ||
@@ -1582,7 +1588,33 @@ | ||
F("___"), | ||
F("____") | ||
}; | ||
- (void)ctors; | ||
+ | ||
+ struct MoveOrCopy { | ||
+ Embed e; | ||
+ EmbedDerived ed; | ||
+ F f; | ||
+ // no-error | ||
+ MoveOrCopy(const MoveOrCopy &c) : e(c.e), ed(c.ed), f(c.f) {} | ||
+ // no-error | ||
+ MoveOrCopy(MoveOrCopy &&c) | ||
+ : e(std::move(c.e)), ed(std::move(c.ed)), f(std::move(c.f)) {} | ||
+ }; | ||
+ F copy1(ctors[0]); // no-error | ||
+ (void)copy1; | ||
+ F move1(std::move(ctors[0])); // no-error | ||
+ (void)move1; | ||
+ F copy2{ctors[0]}; // no-error | ||
+ (void)copy2; | ||
+ F move2{std::move(ctors[0])}; // no-error | ||
+ (void)move2; | ||
+ F copy3 = ctors[0]; // no-error | ||
+ (void)copy3; | ||
+ F move3 = std::move(ctors[0]); // no-error | ||
+ (void)move3; | ||
+ F copy4 = {ctors[0]}; // no-error | ||
+ (void)copy4; | ||
+ F move4 = {std::move(ctors[0])}; // no-error | ||
+ (void)move4; | ||
|
||
S::foo(S{1, 2, 3, 4}); | ||
S::foo(S{.s1 = 100, .s4 = 100}); | ||
diff -ruN --strip-trailing-cr a/llvm/include/llvm/DebugInfo/DWARF/DWARFVerifier.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFVerifier.h | ||
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFVerifier.h | ||
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFVerifier.h | ||
@@ -30,15 +30,9 @@ | ||
class DataExtractor; | ||
struct DWARFSection; | ||
|
||
-struct AggregationData { | ||
- unsigned OverallCount; | ||
- std::map<std::string, unsigned> DetailedCounts; | ||
- AggregationData() = default; | ||
-}; | ||
- | ||
class OutputCategoryAggregator { | ||
private: | ||
- std::map<std::string, AggregationData> Aggregation; | ||
+ std::map<std::string, unsigned> Aggregation; | ||
bool IncludeDetail; | ||
|
||
public: | ||
@@ -46,13 +40,8 @@ | ||
: IncludeDetail(includeDetail) {} | ||
void ShowDetail(bool showDetail) { IncludeDetail = showDetail; } | ||
size_t GetNumCategories() const { return Aggregation.size(); } | ||
- void Report(StringRef category, std::function<void()> detailCallback); | ||
- void Report(StringRef category, StringRef sub_category, | ||
- std::function<void()> detailCallback); | ||
+ void Report(StringRef s, std::function<void()> detailCallback); | ||
void EnumerateResults(std::function<void(StringRef, unsigned)> handleCounts); | ||
- void EnumerateDetailedResultsFor( | ||
- StringRef category, | ||
- std::function<void(StringRef, unsigned)> handleCounts); | ||
}; | ||
|
||
/// A class that verifies DWARF debug information given a DWARF Context. | ||
diff -ruN --strip-trailing-cr a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp | ||
--- a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp | ||
+++ b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp | ||
@@ -1941,14 +1941,12 @@ | ||
if (none_of(NI.equal_range(Name), [&](const DWARFDebugNames::Entry &E) { | ||
return E.getDIEUnitOffset() == DieUnitOffset; | ||
})) { | ||
- ErrorCategory.Report( | ||
- "Name Index DIE entry missing name", | ||
- llvm::dwarf::TagString(Die.getTag()), [&]() { | ||
- error() << formatv( | ||
- "Name Index @ {0:x}: Entry for DIE @ {1:x} ({2}) with " | ||
- "name {3} missing.\n", | ||
- NI.getUnitOffset(), Die.getOffset(), Die.getTag(), Name); | ||
- }); | ||
+ ErrorCategory.Report("Name Index DIE entry missing name", [&]() { | ||
+ error() << formatv( | ||
+ "Name Index @ {0:x}: Entry for DIE @ {1:x} ({2}) with " | ||
+ "name {3} missing.\n", | ||
+ NI.getUnitOffset(), Die.getOffset(), Die.getTag(), Name); | ||
+ }); | ||
++NumErrors; | ||
} | ||
} | ||
@@ -2170,35 +2168,15 @@ | ||
|
||
void OutputCategoryAggregator::Report( | ||
StringRef s, std::function<void(void)> detailCallback) { | ||
- this->Report(s, "", detailCallback); | ||
-} | ||
- | ||
-void OutputCategoryAggregator::Report( | ||
- StringRef category, StringRef sub_category, | ||
- std::function<void(void)> detailCallback) { | ||
- std::string category_str = std::string(category); | ||
- AggregationData *Agg = &Aggregation[category_str]; | ||
- Agg->OverallCount++; | ||
- if (!sub_category.empty()) { | ||
- Agg->DetailedCounts[std::string(sub_category)]++; | ||
- } | ||
+ Aggregation[std::string(s)]++; | ||
if (IncludeDetail) | ||
detailCallback(); | ||
} | ||
|
||
void OutputCategoryAggregator::EnumerateResults( | ||
std::function<void(StringRef, unsigned)> handleCounts) { | ||
- for (auto &&[name, aggData] : Aggregation) { | ||
- handleCounts(name, aggData.OverallCount); | ||
- } | ||
-} | ||
-void OutputCategoryAggregator::EnumerateDetailedResultsFor( | ||
- StringRef category, std::function<void(StringRef, unsigned)> handleCounts) { | ||
- auto Agg = Aggregation.find(std::string(category)); | ||
- if (Agg != Aggregation.end()) { | ||
- for (auto &&[name, count] : Agg->second.DetailedCounts) { | ||
- handleCounts(name, count); | ||
- } | ||
+ for (auto &&[name, count] : Aggregation) { | ||
+ handleCounts(name, count); | ||
} | ||
} | ||
|
||
@@ -2225,12 +2203,6 @@ | ||
ErrorCategory.EnumerateResults([&](StringRef Category, unsigned Count) { | ||
llvm::json::Object Val; | ||
Val.try_emplace("count", Count); | ||
- llvm::json::Object Details; | ||
- ErrorCategory.EnumerateDetailedResultsFor( | ||
- Category, [&](StringRef SubCategory, unsigned SubCount) { | ||
- Details.try_emplace(SubCategory, SubCount); | ||
- }); | ||
- Val.try_emplace("details", std::move(Details)); | ||
Categories.try_emplace(Category, std::move(Val)); | ||
ErrorCount += Count; | ||
}); | ||
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 | ||
--- 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 | ||
@@ -1,172 +0,0 @@ | ||
-# RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj -o - | not llvm-dwarfdump -verify --verify-json=%t.json - | ||
-# RUN: FileCheck %s --input-file %t.json | ||
- | ||
-# 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} | ||
-# CHECK-NOT: error: Name Index @ 0x0: Entry for DIE @ {{.*}} (DW_TAG_variable) with name var_block_addr missing. | ||
- | ||
- .section .debug_loc,"",@progbits | ||
-.Ldebug_loc0: | ||
- .quad 0 | ||
- .quad 1 | ||
- .short .Lloc0_end-.Lloc0_start # Loc expr size | ||
-.Lloc0_start: | ||
- .byte 3 # DW_OP_addr | ||
- .quad 0x47 | ||
-.Lloc0_end: | ||
- .quad 0 | ||
- .quad 0 | ||
- | ||
- .section .debug_abbrev,"",@progbits | ||
- .byte 1 # Abbreviation Code | ||
- .byte 17 # DW_TAG_compile_unit | ||
- .byte 1 # DW_CHILDREN_yes | ||
- .byte 37 # DW_AT_producer | ||
- .byte 8 # DW_FORM_string | ||
- .byte 17 # DW_AT_low_pc | ||
- .byte 1 # DW_FORM_addr | ||
- .byte 18 # DW_AT_high_pc | ||
- .byte 6 # DW_FORM_data4 | ||
- .byte 0 # EOM(1) | ||
- .byte 0 # EOM(2) | ||
- | ||
- .byte 2 # Abbreviation Code | ||
- .byte 52 # DW_TAG_variable | ||
- .byte 0 # DW_CHILDREN_no | ||
- .byte 3 # DW_AT_name | ||
- .byte 8 # DW_FORM_string | ||
- .byte 2 # DW_AT_location | ||
- .byte 24 # DW_FORM_exprloc | ||
- .byte 0 # EOM(1) | ||
- .byte 0 # EOM(2) | ||
- | ||
- .byte 3 # Abbreviation Code | ||
- .byte 46 # DW_TAG_subprogram | ||
- .byte 1 # DW_CHILDREN_yes | ||
- .byte 3 # DW_AT_name | ||
- .byte 8 # DW_FORM_string | ||
- .byte 110 # DW_AT_linkage_name | ||
- .byte 8 # DW_FORM_string | ||
- .byte 82 # DW_AT_entry_pc | ||
- .byte 1 # DW_FORM_addr | ||
- .byte 0 # EOM(1) | ||
- .byte 0 # EOM(2) | ||
- | ||
- .byte 4 # Abbreviation Code | ||
- .byte 57 # DW_TAG_namespace | ||
- .byte 1 # DW_CHILDREN_yes | ||
- .byte 3 # DW_AT_name | ||
- .byte 8 # DW_FORM_string | ||
- .byte 0 # EOM(1) | ||
- .byte 0 # EOM(2) | ||
- | ||
- .byte 5 # Abbreviation Code | ||
- .byte 52 # DW_TAG_variable | ||
- .byte 0 # DW_CHILDREN_no | ||
- .byte 3 # DW_AT_name | ||
- .byte 8 # DW_FORM_string | ||
- .byte 2 # DW_AT_location | ||
- .byte 23 # DW_FORM_sec_offset | ||
- .byte 0 # EOM(1) | ||
- .byte 0 # EOM(2) | ||
- | ||
- .byte 6 # Abbreviation Code | ||
- .byte 57 # DW_TAG_namespace | ||
- .byte 1 # DW_CHILDREN_yes | ||
- .byte 0 # EOM(1) | ||
- .byte 0 # EOM(2) | ||
- | ||
- .byte 7 # Abbreviation Code | ||
- .byte 29 # DW_TAG_inlined_subroutine | ||
- .byte 0 # DW_CHILDREN_no | ||
- .byte 3 # DW_AT_name | ||
- .byte 8 # DW_FORM_string | ||
- .byte 17 # DW_AT_low_pc | ||
- .byte 1 # DW_FORM_addr | ||
- .byte 18 # DW_AT_high_pc | ||
- .byte 1 # DW_FORM_addr | ||
- .byte 0 # EOM(1) | ||
- .byte 0 # EOM(2) | ||
- | ||
- .byte 8 # Abbreviation Code | ||
- .byte 10 # DW_TAG_label | ||
- .byte 0 # DW_CHILDREN_no | ||
- .byte 3 # DW_AT_name | ||
- .byte 8 # DW_FORM_string | ||
- .byte 82 # DW_AT_entry_pc | ||
- .byte 1 # DW_FORM_addr | ||
- .byte 0 # EOM(1) | ||
- .byte 0 # EOM(2) | ||
- | ||
- .byte 0 # EOM(3) | ||
- .section .debug_info,"",@progbits | ||
- | ||
-.Lcu_begin0: | ||
- .long .Lcu_end0-.Lcu_start0 # Length of Unit | ||
-.Lcu_start0: | ||
- .short 4 # DWARF version number | ||
- .long .debug_abbrev # Offset Into Abbrev. Section | ||
- .byte 8 # Address Size (in bytes) | ||
- .byte 1 # Abbrev [1] DW_TAG_compile_unit | ||
- .asciz "hand-written DWARF" # DW_AT_producer | ||
- .quad 0x0 # DW_AT_low_pc | ||
- .long 0x100 # DW_AT_high_pc | ||
- | ||
- .byte 4 # Abbrev [4] DW_TAG_namespace | ||
- .asciz "namesp" # DW_AT_name | ||
- .byte 2 # Abbrev [2] DW_TAG_variable | ||
- .asciz "var_block_addr" # DW_AT_name | ||
- .byte 9 # DW_AT_location | ||
- .byte 3 # DW_OP_addr | ||
- .quad 0x47 | ||
- .byte 0 # End Of Children Mark | ||
- | ||
- .byte 6 # Abbrev [6] DW_TAG_namespace | ||
- .byte 5 # Abbrev [5] DW_TAG_variable | ||
- .asciz "var_loc_addr" # DW_AT_name | ||
- .long .Ldebug_loc0 # DW_AT_location | ||
- .byte 0 # End Of Children Mark | ||
- | ||
- .byte 2 # Abbrev [2] DW_TAG_variable | ||
- .asciz "var_loc_tls" # DW_AT_name | ||
- .byte 1 # DW_AT_location | ||
- .byte 0x9b # DW_OP_form_tls_address | ||
- | ||
- .byte 2 # Abbrev [2] DW_TAG_variable | ||
- .asciz "var_loc_gnu_tls" # DW_AT_name | ||
- .byte 1 # DW_AT_location | ||
- .byte 0xe0 # DW_OP_GNU_push_tls_address | ||
- | ||
- .byte 3 # Abbrev [3] DW_TAG_subprogram | ||
- .asciz "fun_name" # DW_AT_name | ||
- .asciz "_Z8fun_name" # DW_AT_linkage_name | ||
- .quad 0x47 # DW_AT_entry_pc | ||
- .byte 7 # Abbrev [7] DW_TAG_inlined_subroutine | ||
- .asciz "fun_inline" # DW_AT_name | ||
- .quad 0x48 # DW_AT_low_pc | ||
- .quad 0x49 # DW_AT_high_pc | ||
- .byte 8 # Abbrev [8] DW_TAG_label | ||
- .asciz "label" # DW_AT_name | ||
- .quad 0x4a # DW_AT_entry_pc | ||
- .byte 0 # End Of Children Mark | ||
- | ||
- .byte 0 # End Of Children Mark | ||
-.Lcu_end0: | ||
- | ||
- .section .debug_names,"",@progbits | ||
- .long .Lnames_end0-.Lnames_start0 # Header: contribution length | ||
-.Lnames_start0: | ||
- .short 5 # Header: version | ||
- .short 0 # Header: padding | ||
- .long 1 # Header: compilation unit count | ||
- .long 0 # Header: local type unit count | ||
- .long 0 # Header: foreign type unit count | ||
- .long 0 # Header: bucket count | ||
- .long 0 # Header: name count | ||
- .long .Lnames_abbrev_end0-.Lnames_abbrev_start0 # Header: abbreviation table size | ||
- .long 0 # Header: augmentation length | ||
- .long .Lcu_begin0 # Compilation unit 0 | ||
-.Lnames_abbrev_start0: | ||
- .byte 0 # End of abbrev list | ||
-.Lnames_abbrev_end0: | ||
-.Lnames_entries0: | ||
-.Lnames_end0: | ||
diff -ruN --strip-trailing-cr a/llvm/test/Transforms/StructurizeCFG/simple-structurizecfg-crash.ll b/llvm/test/Transforms/StructurizeCFG/simple-structurizecfg-crash.ll | ||
--- a/llvm/test/Transforms/StructurizeCFG/simple-structurizecfg-crash.ll | ||
+++ b/llvm/test/Transforms/StructurizeCFG/simple-structurizecfg-crash.ll | ||
@@ -1,4 +1,5 @@ | ||
; RUN: opt -S -passes=structurizecfg %s -o - | ||
+; REQUIRES: asserts | ||
; XFAIL: * | ||
|
||
; Issue tracking: https://github.com/llvm/llvm-project/issues/126534. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters