Skip to content

Commit ad4e4a0

Browse files
author
iclsrc
committed
Merge from 'main' to 'sycl-web'
2 parents a3173a8 + 35e60f5 commit ad4e4a0

File tree

170 files changed

+8045
-3066
lines changed

Some content is hidden

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

170 files changed

+8045
-3066
lines changed

bolt/lib/Profile/DataAggregator.cpp

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,8 +1295,8 @@ std::error_code DataAggregator::printLBRHeatMap() {
12951295
opts::HeatmapMaxAddress);
12961296
uint64_t NumTotalSamples = 0;
12971297

1298-
while (hasData()) {
1299-
if (opts::BasicAggregation) {
1298+
if (opts::BasicAggregation) {
1299+
while (hasData()) {
13001300
ErrorOr<PerfBasicSample> SampleRes = parseBasicSample();
13011301
if (std::error_code EC = SampleRes.getError()) {
13021302
if (EC == errc::no_such_process)
@@ -1306,7 +1306,10 @@ std::error_code DataAggregator::printLBRHeatMap() {
13061306
PerfBasicSample &Sample = SampleRes.get();
13071307
HM.registerAddress(Sample.PC);
13081308
NumTotalSamples++;
1309-
} else {
1309+
}
1310+
outs() << "HEATMAP: read " << NumTotalSamples << " basic samples\n";
1311+
} else {
1312+
while (hasData()) {
13101313
ErrorOr<PerfBranchSample> SampleRes = parseBranchSample();
13111314
if (std::error_code EC = SampleRes.getError()) {
13121315
if (EC == errc::no_such_process)
@@ -1334,23 +1337,22 @@ std::error_code DataAggregator::printLBRHeatMap() {
13341337
}
13351338
NumTotalSamples += Sample.LBR.size();
13361339
}
1340+
outs() << "HEATMAP: read " << NumTotalSamples << " LBR samples\n";
1341+
outs() << "HEATMAP: " << FallthroughLBRs.size() << " unique traces\n";
13371342
}
13381343

13391344
if (!NumTotalSamples) {
1340-
if (!opts::BasicAggregation) {
1345+
if (opts::BasicAggregation) {
1346+
errs() << "HEATMAP-ERROR: no basic event samples detected in profile. "
1347+
"Cannot build heatmap.";
1348+
} else {
13411349
errs() << "HEATMAP-ERROR: no LBR traces detected in profile. "
13421350
"Cannot build heatmap. Use -nl for building heatmap from "
13431351
"basic events.\n";
1344-
} else {
1345-
errs() << "HEATMAP-ERROR: no samples detected in profile. "
1346-
"Cannot build heatmap.";
13471352
}
13481353
exit(1);
13491354
}
13501355

1351-
outs() << "HEATMAP: read " << NumTotalSamples << " LBR samples\n";
1352-
outs() << "HEATMAP: " << FallthroughLBRs.size() << " unique traces\n";
1353-
13541356
outs() << "HEATMAP: building heat map...\n";
13551357

13561358
for (const auto &LBR : FallthroughLBRs) {

clang-tools-extra/clangd/unittests/TUSchedulerTests.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,22 +281,22 @@ TEST_F(TUSchedulerTests, Cancellation) {
281281
// R2B
282282
// U3(WantDiags=Yes)
283283
// R3 <-- cancelled
284-
std::vector<std::string> DiagsSeen, ReadsSeen, ReadsCanceled;
284+
std::vector<StringRef> DiagsSeen, ReadsSeen, ReadsCanceled;
285285
{
286286
Notification Proceed; // Ensure we schedule everything.
287287
TUScheduler S(CDB, optsForTest(), captureDiags());
288288
auto Path = testPath("foo.cpp");
289289
// Helper to schedule a named update and return a function to cancel it.
290-
auto Update = [&](std::string ID) -> Canceler {
290+
auto Update = [&](StringRef ID) -> Canceler {
291291
auto T = cancelableTask();
292292
WithContext C(std::move(T.first));
293293
updateWithDiags(
294-
S, Path, "//" + ID, WantDiagnostics::Yes,
294+
S, Path, ("//" + ID).str(), WantDiagnostics::Yes,
295295
[&, ID](std::vector<Diag> Diags) { DiagsSeen.push_back(ID); });
296296
return std::move(T.second);
297297
};
298298
// Helper to schedule a named read and return a function to cancel it.
299-
auto Read = [&](std::string ID) -> Canceler {
299+
auto Read = [&](StringRef ID) -> Canceler {
300300
auto T = cancelableTask();
301301
WithContext C(std::move(T.first));
302302
S.runWithAST(ID, Path, [&, ID](llvm::Expected<InputsAndAST> E) {

clang/cmake/caches/CrossWinToARMLinux.cmake

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,6 @@ if(DEFINED REMOTE_TEST_HOST)
176176
set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBUNWIND_TARGET_INFO "${DEFAULT_TEST_TARGET_INFO}" CACHE STRING "")
177177
set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBUNWIND_EXECUTOR "${DEFAULT_TEST_EXECUTOR}" CACHE STRING "")
178178

179-
#NOTE: temporary workaround to fix the remote execution for libunwind tests.
180-
# https://reviews.llvm.org/D112082
181-
set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBUNWIND_TEST_CONFIG "${LLVM_PROJECT_DIR}/libunwind/test/lit.site.cfg.in" CACHE PATH "")
182-
183179
set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXXABI_TARGET_INFO "${DEFAULT_TEST_TARGET_INFO}" CACHE STRING "")
184180
set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXXABI_EXECUTOR "${DEFAULT_TEST_EXECUTOR}" CACHE STRING "")
185181
set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_TARGET_INFO "${DEFAULT_TEST_TARGET_INFO}" CACHE STRING "")

clang/include/clang/Basic/SourceManager.h

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -900,22 +900,26 @@ class SourceManager : public RefCountedBase<SourceManager> {
900900
FileID getOrCreateFileID(const FileEntry *SourceFile,
901901
SrcMgr::CharacteristicKind FileCharacter);
902902

903-
/// Return a new SourceLocation that encodes the
904-
/// fact that a token from SpellingLoc should actually be referenced from
905-
/// ExpansionLoc, and that it represents the expansion of a macro argument
906-
/// into the function-like macro body.
907-
SourceLocation createMacroArgExpansionLoc(SourceLocation Loc,
903+
/// Creates an expansion SLocEntry for the substitution of an argument into a
904+
/// function-like macro's body. Returns the start of the expansion.
905+
///
906+
/// The macro argument was written at \p SpellingLoc with length \p Length.
907+
/// \p ExpansionLoc is the parameter name in the (expanded) macro body.
908+
SourceLocation createMacroArgExpansionLoc(SourceLocation SpellingLoc,
908909
SourceLocation ExpansionLoc,
909-
unsigned TokLength);
910+
unsigned Length);
910911

911-
/// Return a new SourceLocation that encodes the fact
912-
/// that a token from SpellingLoc should actually be referenced from
913-
/// ExpansionLoc.
914-
SourceLocation
915-
createExpansionLoc(SourceLocation Loc, SourceLocation ExpansionLocStart,
916-
SourceLocation ExpansionLocEnd, unsigned TokLength,
917-
bool ExpansionIsTokenRange = true, int LoadedID = 0,
918-
SourceLocation::UIntTy LoadedOffset = 0);
912+
/// Creates an expansion SLocEntry for a macro use. Returns its start.
913+
///
914+
/// The macro body begins at \p SpellingLoc with length \p Length.
915+
/// The macro use spans [ExpansionLocStart, ExpansionLocEnd].
916+
SourceLocation createExpansionLoc(SourceLocation SpellingLoc,
917+
SourceLocation ExpansionLocStart,
918+
SourceLocation ExpansionLocEnd,
919+
unsigned Length,
920+
bool ExpansionIsTokenRange = true,
921+
int LoadedID = 0,
922+
SourceLocation::UIntTy LoadedOffset = 0);
919923

920924
/// Return a new SourceLocation that encodes that the token starting
921925
/// at \p TokenStart ends prematurely at \p TokenEnd.
@@ -1803,7 +1807,7 @@ class SourceManager : public RefCountedBase<SourceManager> {
18031807
/// the SLocEntry table and producing a source location that refers to it.
18041808
SourceLocation
18051809
createExpansionLocImpl(const SrcMgr::ExpansionInfo &Expansion,
1806-
unsigned TokLength, int LoadedID = 0,
1810+
unsigned Length, int LoadedID = 0,
18071811
SourceLocation::UIntTy LoadedOffset = 0);
18081812

18091813
/// Return true if the specified FileID contains the

clang/include/clang/Serialization/ASTWriter.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,6 @@ class ASTWriter : public ASTDeserializationListener,
477477
bool isModule);
478478

479479
unsigned TypeExtQualAbbrev = 0;
480-
unsigned TypeFunctionProtoAbbrev = 0;
481480
void WriteTypeAbbrevs();
482481
void WriteType(QualType T);
483482

@@ -682,10 +681,6 @@ class ASTWriter : public ASTDeserializationListener,
682681
return TypeExtQualAbbrev;
683682
}
684683

685-
unsigned getTypeFunctionProtoAbbrev() const {
686-
return TypeFunctionProtoAbbrev;
687-
}
688-
689684
unsigned getDeclParmVarAbbrev() const { return DeclParmVarAbbrev; }
690685
unsigned getDeclRecordAbbrev() const { return DeclRecordAbbrev; }
691686
unsigned getDeclTypedefAbbrev() const { return DeclTypedefAbbrev; }

clang/lib/AST/ASTImporter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9299,13 +9299,13 @@ Expected<FileID> ASTImporter::Import(FileID FromID, bool IsBuiltin) {
92999299
ExpectedSLoc ToExLocS = Import(FromEx.getExpansionLocStart());
93009300
if (!ToExLocS)
93019301
return ToExLocS.takeError();
9302-
unsigned TokenLen = FromSM.getFileIDSize(FromID);
9302+
unsigned ExLength = FromSM.getFileIDSize(FromID);
93039303
SourceLocation MLoc;
93049304
if (FromEx.isMacroArgExpansion()) {
9305-
MLoc = ToSM.createMacroArgExpansionLoc(*ToSpLoc, *ToExLocS, TokenLen);
9305+
MLoc = ToSM.createMacroArgExpansionLoc(*ToSpLoc, *ToExLocS, ExLength);
93069306
} else {
93079307
if (ExpectedSLoc ToExLocE = Import(FromEx.getExpansionLocEnd()))
9308-
MLoc = ToSM.createExpansionLoc(*ToSpLoc, *ToExLocS, *ToExLocE, TokenLen,
9308+
MLoc = ToSM.createExpansionLoc(*ToSpLoc, *ToExLocS, *ToExLocE, ExLength,
93099309
FromEx.isExpansionTokenRange());
93109310
else
93119311
return ToExLocE.takeError();

clang/lib/Analysis/RetainSummaryManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ const RetainSummary *RetainSummaryManager::getSummaryForObjCOrCFObject(
398398
} else if (FName.startswith("NSLog")) {
399399
return getDoNothingSummary();
400400
} else if (FName.startswith("NS") && FName.contains("Insert")) {
401-
// Whitelist NSXXInsertXX, for example NSMapInsertIfAbsent, since they can
401+
// Allowlist NSXXInsertXX, for example NSMapInsertIfAbsent, since they can
402402
// be deallocated by NSMapRemove. (radar://11152419)
403403
ScratchArgs = AF.add(ScratchArgs, 1, ArgEffect(StopTracking));
404404
ScratchArgs = AF.add(ScratchArgs, 2, ArgEffect(StopTracking));

clang/lib/Basic/SourceManager.cpp

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -629,23 +629,21 @@ FileID SourceManager::createFileIDImpl(ContentCache &File, StringRef Filename,
629629
return LastFileIDLookup = FID;
630630
}
631631

632-
SourceLocation
633-
SourceManager::createMacroArgExpansionLoc(SourceLocation SpellingLoc,
634-
SourceLocation ExpansionLoc,
635-
unsigned TokLength) {
632+
SourceLocation SourceManager::createMacroArgExpansionLoc(
633+
SourceLocation SpellingLoc, SourceLocation ExpansionLoc, unsigned Length) {
636634
ExpansionInfo Info = ExpansionInfo::createForMacroArg(SpellingLoc,
637635
ExpansionLoc);
638-
return createExpansionLocImpl(Info, TokLength);
636+
return createExpansionLocImpl(Info, Length);
639637
}
640638

641639
SourceLocation SourceManager::createExpansionLoc(
642640
SourceLocation SpellingLoc, SourceLocation ExpansionLocStart,
643-
SourceLocation ExpansionLocEnd, unsigned TokLength,
641+
SourceLocation ExpansionLocEnd, unsigned Length,
644642
bool ExpansionIsTokenRange, int LoadedID,
645643
SourceLocation::UIntTy LoadedOffset) {
646644
ExpansionInfo Info = ExpansionInfo::create(
647645
SpellingLoc, ExpansionLocStart, ExpansionLocEnd, ExpansionIsTokenRange);
648-
return createExpansionLocImpl(Info, TokLength, LoadedID, LoadedOffset);
646+
return createExpansionLocImpl(Info, Length, LoadedID, LoadedOffset);
649647
}
650648

651649
SourceLocation SourceManager::createTokenSplitLoc(SourceLocation Spelling,
@@ -660,7 +658,7 @@ SourceLocation SourceManager::createTokenSplitLoc(SourceLocation Spelling,
660658

661659
SourceLocation
662660
SourceManager::createExpansionLocImpl(const ExpansionInfo &Info,
663-
unsigned TokLength, int LoadedID,
661+
unsigned Length, int LoadedID,
664662
SourceLocation::UIntTy LoadedOffset) {
665663
if (LoadedID < 0) {
666664
assert(LoadedID != -1 && "Loading sentinel FileID");
@@ -672,12 +670,12 @@ SourceManager::createExpansionLocImpl(const ExpansionInfo &Info,
672670
return SourceLocation::getMacroLoc(LoadedOffset);
673671
}
674672
LocalSLocEntryTable.push_back(SLocEntry::get(NextLocalOffset, Info));
675-
assert(NextLocalOffset + TokLength + 1 > NextLocalOffset &&
676-
NextLocalOffset + TokLength + 1 <= CurrentLoadedOffset &&
673+
assert(NextLocalOffset + Length + 1 > NextLocalOffset &&
674+
NextLocalOffset + Length + 1 <= CurrentLoadedOffset &&
677675
"Ran out of source locations!");
678676
// See createFileID for that +1.
679-
NextLocalOffset += TokLength + 1;
680-
return SourceLocation::getMacroLoc(NextLocalOffset - (TokLength + 1));
677+
NextLocalOffset += Length + 1;
678+
return SourceLocation::getMacroLoc(NextLocalOffset - (Length + 1));
681679
}
682680

683681
llvm::Optional<llvm::MemoryBufferRef>

clang/lib/Serialization/ASTWriter.cpp

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -598,30 +598,6 @@ void ASTWriter::WriteTypeAbbrevs() {
598598
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Type
599599
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 3)); // Quals
600600
TypeExtQualAbbrev = Stream.EmitAbbrev(std::move(Abv));
601-
602-
// Abbreviation for TYPE_FUNCTION_PROTO
603-
Abv = std::make_shared<BitCodeAbbrev>();
604-
Abv->Add(BitCodeAbbrevOp(serialization::TYPE_FUNCTION_PROTO));
605-
// FunctionType
606-
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // ReturnType
607-
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // NoReturn
608-
Abv->Add(BitCodeAbbrevOp(0)); // HasRegParm
609-
Abv->Add(BitCodeAbbrevOp(0)); // RegParm
610-
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 4)); // CC
611-
Abv->Add(BitCodeAbbrevOp(0)); // ProducesResult
612-
Abv->Add(BitCodeAbbrevOp(0)); // NoCallerSavedRegs
613-
Abv->Add(BitCodeAbbrevOp(0)); // NoCfCheck
614-
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // CmseNSCall
615-
// FunctionProtoType
616-
Abv->Add(BitCodeAbbrevOp(0)); // IsVariadic
617-
Abv->Add(BitCodeAbbrevOp(0)); // HasTrailingReturn
618-
Abv->Add(BitCodeAbbrevOp(0)); // TypeQuals
619-
Abv->Add(BitCodeAbbrevOp(0)); // RefQualifier
620-
Abv->Add(BitCodeAbbrevOp(EST_None)); // ExceptionSpec
621-
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // NumParams
622-
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
623-
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Params
624-
TypeFunctionProtoAbbrev = Stream.EmitAbbrev(std::move(Abv));
625601
}
626602

627603
//===----------------------------------------------------------------------===//

clang/lib/Tooling/InterpolatingCompilationDatabase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ class FileIndex {
328328
StringRef Path = Strings.save(StringRef(OriginalPaths[I]).lower());
329329

330330
Paths.emplace_back(Path, I);
331-
Types.push_back(foldType(guessType(Path)));
331+
Types.push_back(foldType(guessType(OriginalPaths[I])));
332332
Stems.emplace_back(sys::path::stem(Path), I);
333333
auto Dir = ++sys::path::rbegin(Path), DirEnd = sys::path::rend(Path);
334334
for (int J = 0; J < DirectorySegmentsIndexed && Dir != DirEnd; ++J, ++Dir)

0 commit comments

Comments
 (0)