Skip to content

Commit 17ba4a7

Browse files
committed
Merge remote-tracking branch 'origin/main' into aballman-wg14-n3037
2 parents 23c58b5 + 739fe98 commit 17ba4a7

File tree

872 files changed

+28818
-15168
lines changed

Some content is hidden

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

872 files changed

+28818
-15168
lines changed

.ci/compute_projects.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,11 @@ def _get_modified_projects(modified_files: list[str]) -> Set[str]:
200200
# documentation builds.
201201
if len(path_parts) > 2 and path_parts[1] == "docs":
202202
continue
203+
# Exclude files for the gn build. We do not test it within premerge
204+
# and changes occur often enough that they otherwise take up
205+
# capacity.
206+
if len(path_parts) > 3 and path_parts[:3] == ("llvm", "utils", "gn"):
207+
continue
203208
modified_projects.add(pathlib.Path(modified_file).parts[0])
204209
return modified_projects
205210

.ci/compute_projects_test.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,15 @@ def test_exclude_docs(self):
179179
self.assertEqual(env_variables["runtimes_to_build"], "")
180180
self.assertEqual(env_variables["runtimes_check_targets"], "")
181181

182+
def test_exclude_gn(self):
183+
env_variables = compute_projects.get_env_variables(
184+
["llvm/utils/gn/build/BUILD.gn"], "Linux"
185+
)
186+
self.assertEqual(env_variables["projects_to_build"], "")
187+
self.assertEqual(env_variables["project_check_targets"], "")
188+
self.assertEqual(env_variables["runtimes_to_build"], "")
189+
self.assertEqual(env_variables["runtimes_check_targets"], "")
190+
182191

183192
if __name__ == "__main__":
184193
unittest.main()

clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -311,18 +311,7 @@ ClangTidyDiagnosticConsumer::ClangTidyDiagnosticConsumer(
311311
: Context(Ctx), ExternalDiagEngine(ExternalDiagEngine),
312312
RemoveIncompatibleErrors(RemoveIncompatibleErrors),
313313
GetFixesFromNotes(GetFixesFromNotes),
314-
EnableNolintBlocks(EnableNolintBlocks) {
315-
316-
if (Context.getOptions().HeaderFilterRegex &&
317-
!Context.getOptions().HeaderFilterRegex->empty())
318-
HeaderFilter =
319-
std::make_unique<llvm::Regex>(*Context.getOptions().HeaderFilterRegex);
320-
321-
if (Context.getOptions().ExcludeHeaderFilterRegex &&
322-
!Context.getOptions().ExcludeHeaderFilterRegex->empty())
323-
ExcludeHeaderFilter = std::make_unique<llvm::Regex>(
324-
*Context.getOptions().ExcludeHeaderFilterRegex);
325-
}
314+
EnableNolintBlocks(EnableNolintBlocks) {}
326315

327316
void ClangTidyDiagnosticConsumer::finalizeLastError() {
328317
if (!Errors.empty()) {
@@ -571,17 +560,30 @@ void ClangTidyDiagnosticConsumer::checkFilters(SourceLocation Location,
571560
}
572561

573562
StringRef FileName(File->getName());
574-
LastErrorRelatesToUserCode =
575-
LastErrorRelatesToUserCode || Sources.isInMainFile(Location) ||
576-
(HeaderFilter &&
577-
(HeaderFilter->match(FileName) &&
578-
!(ExcludeHeaderFilter && ExcludeHeaderFilter->match(FileName))));
563+
LastErrorRelatesToUserCode = LastErrorRelatesToUserCode ||
564+
Sources.isInMainFile(Location) ||
565+
(getHeaderFilter()->match(FileName) &&
566+
!getExcludeHeaderFilter()->match(FileName));
579567

580568
unsigned LineNumber = Sources.getExpansionLineNumber(Location);
581569
LastErrorPassesLineFilter =
582570
LastErrorPassesLineFilter || passesLineFilter(FileName, LineNumber);
583571
}
584572

573+
llvm::Regex *ClangTidyDiagnosticConsumer::getHeaderFilter() {
574+
if (!HeaderFilter)
575+
HeaderFilter =
576+
std::make_unique<llvm::Regex>(*Context.getOptions().HeaderFilterRegex);
577+
return HeaderFilter.get();
578+
}
579+
580+
llvm::Regex *ClangTidyDiagnosticConsumer::getExcludeHeaderFilter() {
581+
if (!ExcludeHeaderFilter)
582+
ExcludeHeaderFilter = std::make_unique<llvm::Regex>(
583+
*Context.getOptions().ExcludeHeaderFilterRegex);
584+
return ExcludeHeaderFilter.get();
585+
}
586+
585587
void ClangTidyDiagnosticConsumer::removeIncompatibleErrors() {
586588
// Each error is modelled as the set of intervals in which it applies
587589
// replacements. To detect overlapping replacements, we use a sweep line

clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,10 @@ class ClangTidyDiagnosticConsumer : public DiagnosticConsumer {
302302
/// context.
303303
llvm::Regex *getHeaderFilter();
304304

305+
/// Returns the \c ExcludeHeaderFilter constructed for the options set in the
306+
/// context.
307+
llvm::Regex *getExcludeHeaderFilter();
308+
305309
/// Updates \c LastErrorRelatesToUserCode and LastErrorPassesLineFilter
306310
/// according to the diagnostic \p Location.
307311
void checkFilters(SourceLocation Location, const SourceManager &Sources);

clang-tools-extra/clang-tidy/ClangTidyOptions.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ ClangTidyOptions ClangTidyOptions::getDefaults() {
194194
Options.WarningsAsErrors = "";
195195
Options.HeaderFileExtensions = {"", "h", "hh", "hpp", "hxx"};
196196
Options.ImplementationFileExtensions = {"c", "cc", "cpp", "cxx"};
197-
Options.HeaderFilterRegex = std::nullopt;
198-
Options.ExcludeHeaderFilterRegex = std::nullopt;
197+
Options.HeaderFilterRegex = "";
198+
Options.ExcludeHeaderFilterRegex = "";
199199
Options.SystemHeaders = false;
200200
Options.FormatStyle = "none";
201201
Options.User = std::nullopt;

clang-tools-extra/clang-tidy/modernize/UseConstraintsCheck.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ static std::vector<FixItHint> handleReturnType(const FunctionDecl *Function,
356356
if (!TypeText)
357357
return {};
358358

359-
SmallVector<const Expr *, 3> ExistingConstraints;
359+
SmallVector<AssociatedConstraint, 3> ExistingConstraints;
360360
Function->getAssociatedConstraints(ExistingConstraints);
361361
if (!ExistingConstraints.empty()) {
362362
// FIXME - Support adding new constraints to existing ones. Do we need to
@@ -404,7 +404,7 @@ handleTrailingTemplateType(const FunctionTemplateDecl *FunctionTemplate,
404404
if (!ConditionText)
405405
return {};
406406

407-
SmallVector<const Expr *, 3> ExistingConstraints;
407+
SmallVector<AssociatedConstraint, 3> ExistingConstraints;
408408
Function->getAssociatedConstraints(ExistingConstraints);
409409
if (!ExistingConstraints.empty()) {
410410
// FIXME - Support adding new constraints to existing ones. Do we need to

clang-tools-extra/clangd/AST.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,7 @@ getQualification(ASTContext &Context, const DeclContext *DestContext,
119119
// There can't be any more tag parents after hitting a namespace.
120120
assert(!ReachedNS);
121121
(void)ReachedNS;
122-
NNS = NestedNameSpecifier::Create(Context, nullptr, false,
123-
TD->getTypeForDecl());
122+
NNS = NestedNameSpecifier::Create(Context, nullptr, TD->getTypeForDecl());
124123
} else if (auto *NSD = llvm::dyn_cast<NamespaceDecl>(CurContext)) {
125124
ReachedNS = true;
126125
NNS = NestedNameSpecifier::Create(Context, nullptr, NSD);

clang-tools-extra/clangd/CodeComplete.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1467,7 +1467,6 @@ bool allowIndex(CodeCompletionContext &CC) {
14671467
return true;
14681468
case NestedNameSpecifier::Super:
14691469
case NestedNameSpecifier::TypeSpec:
1470-
case NestedNameSpecifier::TypeSpecWithTemplate:
14711470
// Unresolved inside a template.
14721471
case NestedNameSpecifier::Identifier:
14731472
return false;

clang-tools-extra/clangd/DumpAST.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ class DumpVisitor : public RecursiveASTVisitor<DumpVisitor> {
157157
NNS_KIND(Identifier);
158158
NNS_KIND(Namespace);
159159
NNS_KIND(TypeSpec);
160-
NNS_KIND(TypeSpecWithTemplate);
161160
NNS_KIND(Global);
162161
NNS_KIND(Super);
163162
NNS_KIND(NamespaceAlias);

clang-tools-extra/clangd/FindTarget.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,6 @@ struct TargetFinder {
500500
}
501501
return;
502502
case NestedNameSpecifier::TypeSpec:
503-
case NestedNameSpecifier::TypeSpecWithTemplate:
504503
add(QualType(NNS->getAsType(), 0), Flags);
505504
return;
506505
case NestedNameSpecifier::Global:

0 commit comments

Comments
 (0)