Skip to content

Commit 6c982b4

Browse files
gribozavrcopybara-github
authored andcommitted
Updates LLVM usage to match [4573c857da88](llvm/llvm-project@4573c857da88) PiperOrigin-RevId: 721738479
1 parent ba4438c commit 6c982b4

File tree

2 files changed

+147
-1
lines changed

2 files changed

+147
-1
lines changed

bazel/import_llvm.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ load(
77

88
def import_llvm(name):
99
"""Imports LLVM."""
10-
LLVM_COMMIT = "3a1e157454ecd186404eafe75882b88bce772340"
10+
LLVM_COMMIT = "4573c857da88b3210d497d9a88a89351a74b5964"
1111

1212
new_git_repository(
1313
name = name,

patches/llvm.patch

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,150 @@
11
Auto generated patch. Do not edit or delete it, even if empty.
2+
diff -ruN --strip-trailing-cr a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp
3+
--- a/clang/lib/AST/StmtPrinter.cpp
4+
+++ b/clang/lib/AST/StmtPrinter.cpp
5+
@@ -1291,8 +1291,14 @@
6+
<< PD->getFunctionScopeIndex();
7+
break;
8+
}
9+
+ case Decl::Decomposition:
10+
+ OS << "decomposition";
11+
+ for (const auto &I : cast<DecompositionDecl>(VD)->bindings())
12+
+ OS << '-' << I->getName();
13+
+ break;
14+
default:
15+
- llvm_unreachable("Unhandled anonymous declaration kind");
16+
+ OS << "unhandled-anonymous-" << VD->getDeclKindName();
17+
+ break;
18+
}
19+
}
20+
if (Node->hasExplicitTemplateArgs()) {
21+
diff -ruN --strip-trailing-cr a/clang/test/Analysis/anonymous-decls.cpp b/clang/test/Analysis/anonymous-decls.cpp
22+
--- a/clang/test/Analysis/anonymous-decls.cpp
23+
+++ b/clang/test/Analysis/anonymous-decls.cpp
24+
@@ -0,0 +1,89 @@
25+
+// RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCFG -triple x86_64-apple-darwin12 -std=c++20 %s 2>&1 | FileCheck %s
26+
+
27+
+struct A {
28+
+ static A a;
29+
+ char b;
30+
+ friend bool operator==(A, A) = default;
31+
+};
32+
+bool _ = A() == A::a;
33+
+
34+
+// FIXME: steps 1 and 5 show anonymous function parameters are
35+
+// not handled correctly.
36+
+
37+
+// CHECK-LABEL: bool operator==(A, A) noexcept = default
38+
+// CHECK-NEXT: [B2 (ENTRY)]
39+
+// CHECK-NEXT: Succs (1): B1
40+
+// CHECK: [B1]
41+
+// CHECK-NEXT: 1: function-parameter-0-0
42+
+// CHECK-NEXT: 2: [B1.1].b
43+
+// CHECK-NEXT: 3: [B1.2] (ImplicitCastExpr, LValueToRValue, char)
44+
+// CHECK-NEXT: 4: [B1.3] (ImplicitCastExpr, IntegralCast, int)
45+
+// CHECK-NEXT: 5: function-parameter-0-1
46+
+// CHECK-NEXT: 6: [B1.5].b
47+
+// CHECK-NEXT: 7: [B1.6] (ImplicitCastExpr, LValueToRValue, char)
48+
+// CHECK-NEXT: 8: [B1.7] (ImplicitCastExpr, IntegralCast, int)
49+
+// CHECK-NEXT: 9: [B1.4] == [B1.8]
50+
+// CHECK-NEXT: 10: return [B1.9];
51+
+// CHECK-NEXT: Preds (1): B2
52+
+// CHECK-NEXT: Succs (1): B0
53+
+// CHECK: [B0 (EXIT)]
54+
+// CHECK-NEXT: Preds (1): B1
55+
+
56+
+namespace std {
57+
+template <class> struct iterator_traits;
58+
+template <class, class> struct pair;
59+
+template <class _Tp> struct iterator_traits<_Tp *> {
60+
+ typedef _Tp &reference;
61+
+};
62+
+template <long, class> struct tuple_element;
63+
+template <class> struct tuple_size;
64+
+template <class _T1, class _T2> struct tuple_size<pair<_T1, _T2>> {
65+
+ static const int value = 2;
66+
+};
67+
+template <class _T1, class _T2> struct tuple_element<0, pair<_T1, _T2>> {
68+
+ using type = _T1;
69+
+};
70+
+template <class _T1, class _T2> struct tuple_element<1, pair<_T1, _T2>> {
71+
+ using type = _T2;
72+
+};
73+
+template <long _Ip, class _T1, class _T2>
74+
+tuple_element<_Ip, pair<_T1, _T2>>::type get(pair<_T1, _T2> &);
75+
+struct __wrap_iter {
76+
+ iterator_traits<pair<int, int> *>::reference operator*();
77+
+ void operator++();
78+
+};
79+
+bool operator!=(__wrap_iter, __wrap_iter);
80+
+struct vector {
81+
+ __wrap_iter begin();
82+
+ __wrap_iter end();
83+
+};
84+
+} // namespace std
85+
+int main() {
86+
+ std::vector v;
87+
+ for (auto &[a, b] : v)
88+
+ ;
89+
+}
90+
+
91+
+// FIXME: On steps 8 and 14, a decomposition is referred by name, which they never have.
92+
+
93+
+// CHECK-LABEL: int main()
94+
+// CHECK: [B3]
95+
+// CHECK-NEXT: 1: operator*
96+
+// CHECK-NEXT: 2: [B3.1] (ImplicitCastExpr, FunctionToPointerDecay, iterator_traits<pair<int, int> *>::reference (*)(void))
97+
+// CHECK-NEXT: 3: __begin1
98+
+// CHECK-NEXT: 4: * [B3.3] (OperatorCall)
99+
+// CHECK-NEXT: 5: auto &;
100+
+// CHECK-NEXT: 6: get<0UL>
101+
+// CHECK-NEXT: 7: [B3.6] (ImplicitCastExpr, FunctionToPointerDecay, typename tuple_element<0L, pair<int, int> >::type (*)(pair<int, int> &))
102+
+// CHECK-NEXT: 8: decomposition-a-b
103+
+// CHECK-NEXT: 9: [B3.7]([B3.8])
104+
+// CHECK-NEXT: 10: [B3.9]
105+
+// CHECK-NEXT: 11: std::tuple_element<0, std::pair<int, int>>::type a = get<0UL>(decomposition-a-b);
106+
+// CHECK-NEXT: 12: get<1UL>
107+
+// CHECK-NEXT: 13: [B3.12] (ImplicitCastExpr, FunctionToPointerDecay, typename tuple_element<1L, pair<int, int> >::type (*)(pair<int, int> &))
108+
+// CHECK-NEXT: 14: decomposition-a-b
109+
+// CHECK-NEXT: 15: [B3.13]([B3.14])
110+
+// CHECK-NEXT: 16: [B3.15]
111+
+// CHECK-NEXT: 17: std::tuple_element<1, std::pair<int, int>>::type b = get<1UL>(decomposition-a-b);
112+
+// CHECK-NEXT: Preds (1): B1
113+
+// CHECK-NEXT: Succs (1): B2
114+
diff -ruN --strip-trailing-cr a/clang/test/Analysis/anonymous-parameter.cpp b/clang/test/Analysis/anonymous-parameter.cpp
115+
--- a/clang/test/Analysis/anonymous-parameter.cpp
116+
+++ b/clang/test/Analysis/anonymous-parameter.cpp
117+
@@ -1,30 +0,0 @@
118+
-// RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCFG -triple x86_64-apple-darwin12 -std=c++20 %s 2>&1 | FileCheck %s
119+
-
120+
-struct A {
121+
- static A a;
122+
- char b;
123+
- friend bool operator==(A, A) = default;
124+
-};
125+
-bool _ = A() == A::a;
126+
-
127+
-// FIXME: steps 1 and 5 show anonymous function parameters are
128+
-// not handled correctly.
129+
-
130+
-// CHECK-LABEL: bool operator==(A, A) noexcept = default
131+
-// CHECK-NEXT: [B2 (ENTRY)]
132+
-// CHECK-NEXT: Succs (1): B1
133+
-// CHECK: [B1]
134+
-// CHECK-NEXT: 1: function-parameter-0-0
135+
-// CHECK-NEXT: 2: [B1.1].b
136+
-// CHECK-NEXT: 3: [B1.2] (ImplicitCastExpr, LValueToRValue, char)
137+
-// CHECK-NEXT: 4: [B1.3] (ImplicitCastExpr, IntegralCast, int)
138+
-// CHECK-NEXT: 5: function-parameter-0-1
139+
-// CHECK-NEXT: 6: [B1.5].b
140+
-// CHECK-NEXT: 7: [B1.6] (ImplicitCastExpr, LValueToRValue, char)
141+
-// CHECK-NEXT: 8: [B1.7] (ImplicitCastExpr, IntegralCast, int)
142+
-// CHECK-NEXT: 9: [B1.4] == [B1.8]
143+
-// CHECK-NEXT: 10: return [B1.9];
144+
-// CHECK-NEXT: Preds (1): B2
145+
-// CHECK-NEXT: Succs (1): B0
146+
-// CHECK: [B0 (EXIT)]
147+
-// CHECK-NEXT: Preds (1): B1
2148
diff -ruN --strip-trailing-cr a/llvm/include/llvm/Analysis/MemoryProfileInfo.h b/llvm/include/llvm/Analysis/MemoryProfileInfo.h
3149
--- a/llvm/include/llvm/Analysis/MemoryProfileInfo.h
4150
+++ b/llvm/include/llvm/Analysis/MemoryProfileInfo.h

0 commit comments

Comments
 (0)