Skip to content

Commit ee32a67

Browse files
committed
Rebase
Created using spr 1.3.6-beta.1
2 parents ffe130a + f376956 commit ee32a67

File tree

2,124 files changed

+133679
-115020
lines changed

Some content is hidden

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

2,124 files changed

+133679
-115020
lines changed

.ci/monolithic-windows.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
7474
-D MLIR_ENABLE_BINDINGS_PYTHON=ON \
7575
-D CMAKE_EXE_LINKER_FLAGS="/MANIFEST:NO" \
7676
-D CMAKE_MODULE_LINKER_FLAGS="/MANIFEST:NO" \
77-
-D CMAKE_SHARED_LINKER_FLAGS="/MANIFEST:NO" \
78-
-D LLVM_PARALLEL_COMPILE_JOBS=${MAX_PARALLEL_COMPILE_JOBS} \
79-
-D LLVM_PARALLEL_LINK_JOBS=${MAX_PARALLEL_LINK_JOBS}
77+
-D CMAKE_SHARED_LINKER_FLAGS="/MANIFEST:NO"
8078

8179
echo "::endgroup::"
8280
echo "::group::ninja"

.github/workflows/premerge.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,6 @@ jobs:
110110
if: ${{ steps.vars.outputs.windows-projects != '' }}
111111
shell: cmd
112112
run: |
113-
set MAX_PARALLEL_COMPILE_JOBS=64
114-
set MAX_PARALLEL_LINK_JOBS=64
115113
call C:\\BuildTools\\Common7\\Tools\\VsDevCmd.bat -arch=amd64 -host_arch=amd64
116114
bash .ci/monolithic-windows.sh "${{ steps.vars.outputs.windows-projects }}" "${{ steps.vars.outputs.windows-check-targets }}"
117115
- name: Upload Artifacts

bolt/lib/Target/X86/X86MCPlusBuilder.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2441,6 +2441,7 @@ class X86MCPlusBuilder : public MCPlusBuilder {
24412441

24422442
assert(FKI.TargetOffset == 0 && "0-bit relocation offset expected");
24432443
const uint64_t RelOffset = Fixup.getOffset();
2444+
auto [RelSymbol, RelAddend] = extractFixupExpr(Fixup);
24442445

24452446
uint32_t RelType;
24462447
if (Fixup.isPCRel()) {
@@ -2452,6 +2453,9 @@ class X86MCPlusBuilder : public MCPlusBuilder {
24522453
case 32: RelType = ELF::R_X86_64_PC32; break;
24532454
case 64: RelType = ELF::R_X86_64_PC64; break;
24542455
}
2456+
// Adjust PC-relative fixup offsets, which are calculated from the start
2457+
// of the next instruction.
2458+
RelAddend -= FKI.TargetSize / 8;
24552459
} else {
24562460
switch (FKI.TargetSize) {
24572461
default:
@@ -2463,8 +2467,6 @@ class X86MCPlusBuilder : public MCPlusBuilder {
24632467
}
24642468
}
24652469

2466-
auto [RelSymbol, RelAddend] = extractFixupExpr(Fixup);
2467-
24682470
return Relocation({RelOffset, RelSymbol, RelType, RelAddend, 0});
24692471
}
24702472

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

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ namespace clang::tidy {
5555

5656
namespace {
5757
#if CLANG_TIDY_ENABLE_STATIC_ANALYZER
58-
static const char *AnalyzerCheckNamePrefix = "clang-analyzer-";
58+
#define ANALYZER_CHECK_NAME_PREFIX "clang-analyzer-"
59+
static constexpr llvm::StringLiteral AnalyzerCheckNamePrefix =
60+
ANALYZER_CHECK_NAME_PREFIX;
5961

6062
class AnalyzerDiagnosticConsumer : public ento::PathDiagnosticConsumer {
6163
public:
@@ -351,10 +353,9 @@ ClangTidyASTConsumerFactory::ClangTidyASTConsumerFactory(
351353
static void
352354
setStaticAnalyzerCheckerOpts(const ClangTidyOptions &Opts,
353355
clang::AnalyzerOptions &AnalyzerOptions) {
354-
StringRef AnalyzerPrefix(AnalyzerCheckNamePrefix);
355356
for (const auto &Opt : Opts.CheckOptions) {
356357
StringRef OptName(Opt.getKey());
357-
if (!OptName.consume_front(AnalyzerPrefix))
358+
if (!OptName.consume_front(AnalyzerCheckNamePrefix))
358359
continue;
359360
// Analyzer options are always local options so we can ignore priority.
360361
AnalyzerOptions.Config[OptName] = Opt.getValue().Value;
@@ -476,7 +477,8 @@ std::vector<std::string> ClangTidyASTConsumerFactory::getCheckNames() {
476477
#if CLANG_TIDY_ENABLE_STATIC_ANALYZER
477478
for (const auto &AnalyzerCheck : getAnalyzerCheckersAndPackages(
478479
Context, Context.canEnableAnalyzerAlphaCheckers()))
479-
CheckNames.push_back(AnalyzerCheckNamePrefix + AnalyzerCheck.first);
480+
CheckNames.emplace_back(
481+
(AnalyzerCheckNamePrefix + AnalyzerCheck.first).str());
480482
#endif // CLANG_TIDY_ENABLE_STATIC_ANALYZER
481483

482484
llvm::sort(CheckNames);
@@ -668,18 +670,19 @@ getAllChecksAndOptions(bool AllowEnablingAnalyzerAlphaCheckers) {
668670
Buffer.append(AnalyzerCheck);
669671
Result.Checks.insert(Buffer);
670672
}
671-
for (std::string OptionName : {
673+
674+
static constexpr llvm::StringLiteral OptionNames[] = {
672675
#define GET_CHECKER_OPTIONS
673676
#define CHECKER_OPTION(TYPE, CHECKER, OPTION_NAME, DESCRIPTION, DEFAULT, \
674677
RELEASE, HIDDEN) \
675-
Twine(AnalyzerCheckNamePrefix).concat(CHECKER ":" OPTION_NAME).str(),
678+
ANALYZER_CHECK_NAME_PREFIX CHECKER ":" OPTION_NAME,
676679

677680
#include "clang/StaticAnalyzer/Checkers/Checkers.inc"
678681
#undef CHECKER_OPTION
679682
#undef GET_CHECKER_OPTIONS
680-
}) {
681-
Result.Options.insert(OptionName);
682-
}
683+
};
684+
685+
Result.Options.insert_range(OptionNames);
683686
#endif // CLANG_TIDY_ENABLE_STATIC_ANALYZER
684687

685688
Context.setOptionsCollector(&Result.Options);

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,9 @@ void ClangTidyDiagnosticConsumer::forwardDiagnostic(const Diagnostic &Info) {
544544
case clang::DiagnosticsEngine::ak_attr:
545545
Builder << reinterpret_cast<Attr *>(Info.getRawArg(Index));
546546
break;
547+
case clang::DiagnosticsEngine::ak_attr_info:
548+
Builder << reinterpret_cast<AttributeCommonInfo *>(Info.getRawArg(Index));
549+
break;
547550
case clang::DiagnosticsEngine::ak_addrspace:
548551
Builder << static_cast<LangAS>(Info.getRawArg(Index));
549552
break;

clang-tools-extra/clang-tidy/abseil/AbseilMatcher.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ AST_POLYMORPHIC_MATCHER(
4646
if (PrefixPosition == StringRef::npos)
4747
return false;
4848
Path = Path.drop_front(PrefixPosition + AbslPrefix.size());
49-
static const char *AbseilLibraries[] = {
49+
static constexpr llvm::StringLiteral AbseilLibraries[] = {
5050
"algorithm", "base", "container", "debugging", "flags",
5151
"hash", "iterator", "memory", "meta", "numeric",
5252
"profiling", "random", "status", "strings", "synchronization",
5353
"time", "types", "utility"};
54-
return llvm::any_of(AbseilLibraries, [&](const char *Library) {
54+
return llvm::any_of(AbseilLibraries, [&](llvm::StringLiteral Library) {
5555
return Path.starts_with(Library);
5656
});
5757
}

clang-tools-extra/clang-tidy/bugprone/ComparePointerToMemberVirtualFunctionCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace {
2525

2626
AST_MATCHER(CXXMethodDecl, isVirtual) { return Node.isVirtual(); }
2727

28-
static const char *const ErrorMsg =
28+
static constexpr llvm::StringLiteral ErrorMsg =
2929
"comparing a pointer to member virtual function with other pointer is "
3030
"unspecified behavior, only compare it with a null-pointer constant for "
3131
"equality.";

clang-tools-extra/clang-tidy/bugprone/TaggedUnionMemberCountCheck.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ TaggedUnionMemberCountCheck::getNumberOfEnumValues(const EnumDecl *ED) {
144144

145145
if (EnableCountingEnumHeuristic && LastEnumConstant &&
146146
isCountingEnumLikeName(LastEnumConstant->getName()) &&
147-
(LastEnumConstant->getInitVal() == (EnumValues.size() - 1))) {
147+
llvm::APSInt::isSameValue(LastEnumConstant->getInitVal(),
148+
llvm::APSInt::get(EnumValues.size() - 1))) {
148149
return {EnumValues.size() - 1, LastEnumConstant};
149150
}
150151

clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,8 @@ static bool isEmpty(ASTContext &Context, const QualType &Type) {
373373
return isIncompleteOrZeroLengthArrayType(Context, Type);
374374
}
375375

376-
static const char *getInitializer(QualType QT, bool UseAssignment) {
377-
const char *DefaultInitializer = "{}";
376+
static llvm::StringLiteral getInitializer(QualType QT, bool UseAssignment) {
377+
static constexpr llvm::StringLiteral DefaultInitializer = "{}";
378378
if (!UseAssignment)
379379
return DefaultInitializer;
380380

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

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,21 @@ using namespace llvm;
2020

2121
namespace clang::tidy::modernize {
2222

23+
static bool isFirstFriendOfSecond(const CXXRecordDecl *Friend,
24+
const CXXRecordDecl *Class) {
25+
return llvm::any_of(
26+
Class->friends(), [Friend](FriendDecl *FriendDecl) -> bool {
27+
if (TypeSourceInfo *FriendTypeSource = FriendDecl->getFriendType()) {
28+
const QualType FriendType = FriendTypeSource->getType();
29+
return FriendType->getAsCXXRecordDecl() == Friend;
30+
}
31+
return false;
32+
});
33+
}
34+
2335
namespace {
24-
/// Matches move-constructible classes.
36+
/// Matches move-constructible classes whose constructor can be called inside
37+
/// a CXXRecordDecl with a bound ID.
2538
///
2639
/// Given
2740
/// \code
@@ -32,15 +45,33 @@ namespace {
3245
/// Bar(Bar &&) = deleted;
3346
/// int a;
3447
/// };
48+
///
49+
/// class Buz {
50+
/// Buz(Buz &&);
51+
/// int a;
52+
/// friend class Outer;
53+
/// };
54+
///
55+
/// class Outer {
56+
/// };
3557
/// \endcode
36-
/// recordDecl(isMoveConstructible())
37-
/// matches "Foo".
38-
AST_MATCHER(CXXRecordDecl, isMoveConstructible) {
39-
for (const CXXConstructorDecl *Ctor : Node.ctors()) {
40-
if (Ctor->isMoveConstructor() && !Ctor->isDeleted())
41-
return true;
42-
}
43-
return false;
58+
/// recordDecl(isMoveConstructibleInBoundCXXRecordDecl("Outer"))
59+
/// matches "Foo", "Buz".
60+
AST_MATCHER_P(CXXRecordDecl, isMoveConstructibleInBoundCXXRecordDecl, StringRef,
61+
RecordDeclID) {
62+
return Builder->removeBindings(
63+
[this,
64+
&Node](const ast_matchers::internal::BoundNodesMap &Nodes) -> bool {
65+
const auto *BoundClass =
66+
Nodes.getNode(this->RecordDeclID).get<CXXRecordDecl>();
67+
for (const CXXConstructorDecl *Ctor : Node.ctors()) {
68+
if (Ctor->isMoveConstructor() && !Ctor->isDeleted() &&
69+
(Ctor->getAccess() == AS_public ||
70+
(BoundClass && isFirstFriendOfSecond(BoundClass, &Node))))
71+
return false;
72+
}
73+
return true;
74+
});
4475
}
4576
} // namespace
4677

@@ -202,6 +233,7 @@ void PassByValueCheck::registerMatchers(MatchFinder *Finder) {
202233
traverse(
203234
TK_AsIs,
204235
cxxConstructorDecl(
236+
ofClass(cxxRecordDecl().bind("outer")),
205237
forEachConstructorInitializer(
206238
cxxCtorInitializer(
207239
unless(isBaseInitializer()),
@@ -225,8 +257,9 @@ void PassByValueCheck::registerMatchers(MatchFinder *Finder) {
225257
.bind("Param"))))),
226258
hasDeclaration(cxxConstructorDecl(
227259
isCopyConstructor(), unless(isDeleted()),
228-
hasDeclContext(
229-
cxxRecordDecl(isMoveConstructible())))))))
260+
hasDeclContext(cxxRecordDecl(
261+
isMoveConstructibleInBoundCXXRecordDecl(
262+
"outer"))))))))
230263
.bind("Initializer")))
231264
.bind("Ctor")),
232265
this);

0 commit comments

Comments
 (0)