Skip to content

Commit c2248d9

Browse files
authored
merge main into amd-staging (llvm#1356)
2 parents 5c3197e + 7969a75 commit c2248d9

File tree

186 files changed

+8637
-7969
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

186 files changed

+8637
-7969
lines changed

.ci/compute_projects.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@
112112
"polly": "check-polly",
113113
}
114114

115+
RUNTIMES = {"libcxx", "libcxxabi", "libunwind"}
116+
115117

116118
def _add_dependencies(projects: Set[str]) -> Set[str]:
117119
projects_with_dependents = set(projects)
@@ -131,6 +133,8 @@ def _compute_projects_to_test(modified_projects: Set[str], platform: str) -> Set
131133
# Skip all projects where we cannot run tests.
132134
if modified_project not in PROJECT_CHECK_TARGETS:
133135
continue
136+
if modified_project in RUNTIMES:
137+
continue
134138
projects_to_test.add(modified_project)
135139
if modified_project not in DEPENDENTS_TO_TEST:
136140
continue

.ci/compute_projects_test.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,15 @@ def test_top_level_file(self):
161161
self.assertEqual(env_variables["runtimes_to_build"], "")
162162
self.assertEqual(env_variables["runtimes_check_targets"], "")
163163

164+
def test_exclude_runtiems_in_projects(self):
165+
env_variables = compute_projects.get_env_variables(
166+
[".ci/compute_projects.py", "libcxx/CMakeLists.txt"], "Linux"
167+
)
168+
self.assertEqual(env_variables["projects_to_build"], "")
169+
self.assertEqual(env_variables["project_check_targets"], "")
170+
self.assertEqual(env_variables["runtimes_to_build"], "")
171+
self.assertEqual(env_variables["runtimes_check_targets"], "")
172+
164173

165174
if __name__ == "__main__":
166175
unittest.main()

.github/workflows/containers/github-action-ci/Dockerfile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@ RUN apt-get update && \
1414
python3 \
1515
git \
1616
curl \
17-
zlib1g-dev
17+
zlib1g-dev && \
18+
apt-get clean && \
19+
rm -rf /var/lib/apt/lists/*
1820

19-
RUN curl -O -L https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-$LLVM_VERSION.tar.gz && tar -xf llvmorg-$LLVM_VERSION.tar.gz
21+
RUN curl -O -L https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-$LLVM_VERSION.tar.gz && \
22+
tar -xf llvmorg-$LLVM_VERSION.tar.gz && \
23+
rm -f llvmorg-$LLVM_VERSION.tar.gz
2024

2125
WORKDIR /llvm-project-llvmorg-$LLVM_VERSION
2226

@@ -65,7 +69,9 @@ RUN apt-get update && \
6569
python3-pip \
6670
ccache \
6771
file \
68-
tzdata
72+
tzdata && \
73+
apt-get clean && \
74+
rm -rf /var/lib/apt/lists/*
6975

7076
# Install sccache as it is needed by most of the project test workflows and
7177
# cannot be installed by the ccache action when executing as a non-root user.

clang/include/clang/ExtractAPI/ExtractAPIVisitor.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,10 @@ class ExtractAPIVisitorBase : public RecursiveASTVisitor<Derived> {
173173

174174
protected:
175175
SmallVector<SymbolReference> getBases(const CXXRecordDecl *Decl) {
176+
if (!Decl->isCompleteDefinition()) {
177+
return {};
178+
}
179+
176180
// FIXME: store AccessSpecifier given by inheritance
177181
SmallVector<SymbolReference> Bases;
178182
for (const auto &BaseSpecifier : Decl->bases()) {

clang/lib/ExtractAPI/DeclarationFragments.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1225,6 +1225,10 @@ DeclarationFragments
12251225
DeclarationFragmentsBuilder::getFragmentsForClassTemplateSpecialization(
12261226
const ClassTemplateSpecializationDecl *Decl) {
12271227
DeclarationFragments Fragments;
1228+
std::optional<ArrayRef<TemplateArgumentLoc>> TemplateArgumentLocs = {};
1229+
if (auto *TemplateArgs = Decl->getTemplateArgsAsWritten()) {
1230+
TemplateArgumentLocs = TemplateArgs->arguments();
1231+
}
12281232
return Fragments
12291233
.append("template", DeclarationFragments::FragmentKind::Keyword)
12301234
.appendSpace()
@@ -1237,7 +1241,7 @@ DeclarationFragmentsBuilder::getFragmentsForClassTemplateSpecialization(
12371241
.append("<", DeclarationFragments::FragmentKind::Text)
12381242
.append(getFragmentsForTemplateArguments(
12391243
Decl->getTemplateArgs().asArray(), Decl->getASTContext(),
1240-
Decl->getTemplateArgsAsWritten()->arguments()))
1244+
TemplateArgumentLocs))
12411245
.append(">", DeclarationFragments::FragmentKind::Text)
12421246
.appendSemicolon();
12431247
}

clang/lib/StaticAnalyzer/Checkers/WebKit/RefCntblBaseVirtualDtorChecker.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,13 @@ class RefCntblBaseVirtualDtorChecker
202202
if (!C)
203203
continue;
204204

205+
bool isExempt = T.getAsString() == "NoVirtualDestructorBase" &&
206+
safeGetName(C->getParent()) == "WTF";
207+
if (isExempt || ExemptDecls.contains(C)) {
208+
ExemptDecls.insert(RD);
209+
continue;
210+
}
211+
205212
if (auto *CTSD = dyn_cast<ClassTemplateSpecializationDecl>(C)) {
206213
for (auto &Arg : CTSD->getTemplateArgs().asArray()) {
207214
if (Arg.getKind() != TemplateArgument::Type)
@@ -223,12 +230,13 @@ class RefCntblBaseVirtualDtorChecker
223230

224231
llvm::SetVector<const CXXRecordDecl *> Decls;
225232
llvm::DenseSet<const CXXRecordDecl *> CRTPs;
233+
llvm::DenseSet<const CXXRecordDecl *> ExemptDecls;
226234
};
227235

228236
LocalVisitor visitor(this);
229237
visitor.TraverseDecl(const_cast<TranslationUnitDecl *>(TUD));
230238
for (auto *RD : visitor.Decls) {
231-
if (visitor.CRTPs.contains(RD))
239+
if (visitor.CRTPs.contains(RD) || visitor.ExemptDecls.contains(RD))
232240
continue;
233241
visitCXXRecordDecl(RD);
234242
}

clang/test/Analysis/Checkers/WebKit/ref-cntbl-base-virtual-dtor.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
// RUN: %clang_analyze_cc1 -analyzer-checker=webkit.RefCntblBaseVirtualDtor -verify %s
22

3+
namespace WTF {
4+
5+
class NoVirtualDestructorBase { };
6+
7+
};
8+
9+
using WTF::NoVirtualDestructorBase;
10+
311
struct RefCntblBase {
412
void ref() {}
513
void deref() {}
@@ -19,6 +27,15 @@ struct [[clang::suppress]] SuppressedDerivedWithVirtualDtor : RefCntblBase {
1927
virtual ~SuppressedDerivedWithVirtualDtor() {}
2028
};
2129

30+
class ClassWithoutVirtualDestructor : public NoVirtualDestructorBase {
31+
public:
32+
void ref() const;
33+
void deref() const;
34+
};
35+
36+
class DerivedClassWithoutVirtualDestructor : public ClassWithoutVirtualDestructor {
37+
};
38+
2239
// FIXME: Support attributes on base specifiers? Currently clang
2340
// doesn't support such attributes at all, even though it knows
2441
// how to parse them.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Test is line- and column-sensitive. Run lines are below
2+
3+
template <typename T>
4+
class basic_vector {
5+
public:
6+
T x;
7+
T y;
8+
};
9+
10+
using my_vec = basic_vector<int>;
11+
12+
class MyClass {
13+
my_vec myVec;
14+
};
15+
16+
struct OuterStruct {
17+
struct InnerStruct;
18+
int outer_field;
19+
};
20+
21+
// RUN: c-index-test -single-symbol-sgf-at=%s:13:7 local %s | FileCheck --check-prefix=CHECK-VEC-TYPE %s
22+
// CHECK-VEC-TYPE: "parentContexts":[{"kind":"c++.typealias","name":"my_vec","usr":"c:@my_vec"}]
23+
// CHECK-VEC-TYPE: "declarationFragments":[{"kind":"keyword","spelling":"typedef"},{"kind":"text","spelling":" "},{"kind":"typeIdentifier","preciseIdentifier":"c:@ST>1#T@basic_vector","spelling":"basic_vector"},{"kind":"text","spelling":"<"},{"kind":"typeIdentifier","preciseIdentifier":"c:I","spelling":"int"},{"kind":"text","spelling":"> "},{"kind":"identifier","spelling":"my_vec"},{"kind":"text","spelling":";"}]
24+
// CHECK-VEC-TYPE: "identifier":{"interfaceLanguage":"c++","precise":"c:@my_vec"}
25+
// CHECK-VEC-TYPE: "kind":{"displayName":"Type Alias","identifier":"c++.typealias"}
26+
// CHECK-VEC-TYPE: "title":"my_vec"
27+
// CHECK-VEC-TYPE: "pathComponents":["my_vec"]
28+
29+
// RUN: c-index-test -single-symbol-sgf-at=%s:13:13 local %s | FileCheck --check-prefix=CHECK-MYVEC %s
30+
// CHECK-MYVEC: "parentContexts":[{"kind":"c++.class","name":"MyClass","usr":"c:@S@MyClass"},{"kind":"c++.property","name":"myVec","usr":"c:@S@MyClass@FI@myVec"}]
31+
// CHECK-MYVEC: "identifier":{"interfaceLanguage":"c++","precise":"c:@S@MyClass@FI@myVec"}
32+
// CHECK-MYVEC: "kind":{"displayName":"Instance Property","identifier":"c++.property"}
33+
// CHECK-MYVEC: "title":"myVec"
34+
// CHECK-MYVEC: "pathComponents":["MyClass","myVec"]
35+
36+
// RUN: c-index-test -single-symbol-sgf-at=%s:17:17 local %s | FileCheck --check-prefix=CHECK-INNER %s
37+
// CHECK-INNER: "parentContexts":[{"kind":"c++.struct","name":"OuterStruct","usr":"c:@S@OuterStruct"},{"kind":"c++.struct","name":"InnerStruct","usr":"c:@S@OuterStruct@S@InnerStruct"}]
38+
// CHECK-INNER: "identifier":{"interfaceLanguage":"c++","precise":"c:@S@OuterStruct@S@InnerStruct"}
39+
// CHECK-INNER: "kind":{"displayName":"Structure","identifier":"c++.struct"}
40+
// CHECK-INNER: "title":"InnerStruct"
41+
// CHECK-INNER: "pathComponents":["OuterStruct","InnerStruct"]

compiler-rt/cmake/builtin-config-ix.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ builtin_check_c_compiler_flag(-fconvergent-functions COMPILER_RT_HAS_FCONVERGENT
2525
builtin_check_c_compiler_flag("-Xclang -mcode-object-version=none" COMPILER_RT_HAS_CODE_OBJECT_VERSION_FLAG)
2626
builtin_check_c_compiler_flag(-Wbuiltin-declaration-mismatch COMPILER_RT_HAS_WBUILTIN_DECLARATION_MISMATCH_FLAG)
2727
builtin_check_c_compiler_flag(/Zl COMPILER_RT_HAS_ZL_FLAG)
28+
builtin_check_c_compiler_flag(-fcf-protection=full COMPILER_RT_HAS_FCF_PROTECTION_FLAG)
2829

2930
builtin_check_c_compiler_source(COMPILER_RT_HAS_ATOMIC_KEYWORD
3031
"

libcxx/docs/Status/Cxx23Issues.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@
213213
"`LWG3753 <https://wg21.link/LWG3753>`__","Clarify entity vs. freestanding entity","2022-11 (Kona)","","",""
214214
"`LWG3754 <https://wg21.link/LWG3754>`__","Class template expected synopsis contains declarations that do not match the detailed description","2022-11 (Kona)","|Nothing To Do|","",""
215215
"`LWG3755 <https://wg21.link/LWG3755>`__","``tuple-for-each`` can call ``user-defined`` ``operator,``","2022-11 (Kona)","|Complete|","17",""
216-
"`LWG3757 <https://wg21.link/LWG3757>`__","What's the effect of ``std::forward_like<void>(x)``?","2022-11 (Kona)","","",""
216+
"`LWG3757 <https://wg21.link/LWG3757>`__","What's the effect of ``std::forward_like<void>(x)``?","2022-11 (Kona)","|Nothing To Do|","",""
217217
"`LWG3759 <https://wg21.link/LWG3759>`__","``ranges::rotate_copy`` should use ``std::move``","2022-11 (Kona)","|Complete|","15",""
218218
"`LWG3760 <https://wg21.link/LWG3760>`__","``cartesian_product_view::iterator``'s ``parent_`` is never valid","2022-11 (Kona)","","",""
219219
"`LWG3761 <https://wg21.link/LWG3761>`__","``cartesian_product_view::iterator::operator-`` should pass by reference","2022-11 (Kona)","","",""

0 commit comments

Comments
 (0)