Skip to content

Commit 0e8d0ce

Browse files
SC llvm teamSC llvm team
SC llvm team
authored and
SC llvm team
committed
Merged main:438ad9f2bf25575c474313de4ad85a5da6f69e4c into amd-gfx:b82566cedfb0
Local branch amd-gfx b82566c Merged main:a7ba73bf614f6d147bd1cdaddee156bd85e31703 into amd-gfx:34490a8fca3b Remote branch main 438ad9f [clang-format] Revert "[clang-format][NFC] Delete TT_LambdaArrow (#70… (llvm#105923)
2 parents b82566c + 438ad9f commit 0e8d0ce

File tree

29 files changed

+216
-90
lines changed

29 files changed

+216
-90
lines changed

.github/workflows/release-binaries.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,16 +135,8 @@ jobs:
135135
target_cmake_flags="$target_cmake_flags -DBOOTSTRAP_DARWIN_osx_ARCHS=$arches -DBOOTSTRAP_DARWIN_osx_BUILTIN_ARCHS=$arches"
136136
fi
137137
138-
# x86 macOS and x86 Windows have trouble building flang, so disable it.
139-
# Windows: https://github.com/llvm/llvm-project/issues/100202
140-
# macOS: 'rebase opcodes terminated early at offset 1 of 80016' when building __fortran_builtins.mod
141138
build_flang="true"
142139
143-
if [ "$target" = "Windows-X64" ]; then
144-
target_cmake_flags="$target_cmake_flags -DLLVM_RELEASE_ENABLE_PROJECTS=\"clang;lld;lldb;clang-tools-extra;bolt;polly;mlir\""
145-
build_flang="false"
146-
fi
147-
148140
if [ "${{ runner.os }}" = "Windows" ]; then
149141
# The build times out on Windows, so we need to disable LTO.
150142
target_cmake_flags="$target_cmake_flags -DLLVM_RELEASE_ENABLE_LTO=OFF"

clang/cmake/caches/Release.cmake

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,14 @@ set(LLVM_TARGETS_TO_BUILD Native CACHE STRING "")
4747
set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "")
4848

4949
set(STAGE1_PROJECTS "clang")
50-
set(STAGE1_RUNTIMES "")
50+
51+
# Building Flang on Windows requires compiler-rt, so we need to build it in
52+
# stage1. compiler-rt is also required for building the Flang tests on
53+
# macOS.
54+
set(STAGE1_RUNTIMES "compiler-rt")
5155

5256
if (LLVM_RELEASE_ENABLE_PGO)
5357
list(APPEND STAGE1_PROJECTS "lld")
54-
list(APPEND STAGE1_RUNTIMES "compiler-rt")
5558
set(CLANG_BOOTSTRAP_TARGETS
5659
generate-profdata
5760
stage2-package

clang/lib/Format/ContinuationIndenter.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -894,10 +894,8 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun,
894894
CurrentState.ContainsUnwrappedBuilder = true;
895895
}
896896

897-
if (Current.is(TT_TrailingReturnArrow) &&
898-
Style.Language == FormatStyle::LK_Java) {
897+
if (Current.is(TT_LambdaArrow) && Style.Language == FormatStyle::LK_Java)
899898
CurrentState.NoLineBreak = true;
900-
}
901899
if (Current.isMemberAccess() && Previous.is(tok::r_paren) &&
902900
(Previous.MatchingParen &&
903901
(Previous.TotalLength - Previous.MatchingParen->TotalLength > 10))) {
@@ -1052,7 +1050,7 @@ unsigned ContinuationIndenter::addTokenOnNewLine(LineState &State,
10521050
//
10531051
// is common and should be formatted like a free-standing function. The same
10541052
// goes for wrapping before the lambda return type arrow.
1055-
if (Current.isNot(TT_TrailingReturnArrow) &&
1053+
if (Current.isNot(TT_LambdaArrow) &&
10561054
(!Style.isJavaScript() || Current.NestingLevel != 0 ||
10571055
!PreviousNonComment || PreviousNonComment->isNot(tok::equal) ||
10581056
!Current.isOneOf(Keywords.kw_async, Keywords.kw_function))) {
@@ -1312,7 +1310,7 @@ unsigned ContinuationIndenter::getNewLineColumn(const LineState &State) {
13121310
}
13131311
return CurrentState.Indent;
13141312
}
1315-
if (Current.is(TT_TrailingReturnArrow) &&
1313+
if (Current.is(TT_LambdaArrow) &&
13161314
Previous.isOneOf(tok::kw_noexcept, tok::kw_mutable, tok::kw_constexpr,
13171315
tok::kw_consteval, tok::kw_static, TT_AttributeSquare)) {
13181316
return ContinuationIndent;
@@ -1646,7 +1644,7 @@ unsigned ContinuationIndenter::moveStateToNextToken(LineState &State,
16461644
}
16471645
if (Current.isOneOf(TT_BinaryOperator, TT_ConditionalExpr) && Newline)
16481646
CurrentState.NestedBlockIndent = State.Column + Current.ColumnWidth + 1;
1649-
if (Current.isOneOf(TT_LambdaLSquare, TT_TrailingReturnArrow))
1647+
if (Current.isOneOf(TT_LambdaLSquare, TT_LambdaArrow))
16501648
CurrentState.LastSpace = State.Column;
16511649
if (Current.is(TT_RequiresExpression) &&
16521650
Style.RequiresExpressionIndentation == FormatStyle::REI_Keyword) {

clang/lib/Format/FormatToken.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ namespace format {
102102
TYPE(JsTypeColon) \
103103
TYPE(JsTypeOperator) \
104104
TYPE(JsTypeOptionalQuestion) \
105+
TYPE(LambdaArrow) \
105106
TYPE(LambdaDefinitionLParen) \
106107
TYPE(LambdaLBrace) \
107108
TYPE(LambdaLSquare) \
@@ -726,7 +727,7 @@ struct FormatToken {
726727
bool isMemberAccess() const {
727728
return isOneOf(tok::arrow, tok::period, tok::arrowstar) &&
728729
!isOneOf(TT_DesignatedInitializerPeriod, TT_TrailingReturnArrow,
729-
TT_LeadingJavaAnnotation);
730+
TT_LambdaArrow, TT_LeadingJavaAnnotation);
730731
}
731732

732733
bool isPointerOrReference() const {

clang/lib/Format/TokenAnnotator.cpp

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,7 @@ class AnnotatingParser {
833833
}
834834
// An arrow after an ObjC method expression is not a lambda arrow.
835835
if (CurrentToken->is(TT_ObjCMethodExpr) && CurrentToken->Next &&
836-
CurrentToken->Next->is(TT_TrailingReturnArrow)) {
836+
CurrentToken->Next->is(TT_LambdaArrow)) {
837837
CurrentToken->Next->overwriteFixedType(TT_Unknown);
838838
}
839839
Left->MatchingParen = CurrentToken;
@@ -1770,8 +1770,10 @@ class AnnotatingParser {
17701770
}
17711771
break;
17721772
case tok::arrow:
1773-
if (Tok->Previous && Tok->Previous->is(tok::kw_noexcept))
1773+
if (Tok->isNot(TT_LambdaArrow) && Tok->Previous &&
1774+
Tok->Previous->is(tok::kw_noexcept)) {
17741775
Tok->setType(TT_TrailingReturnArrow);
1776+
}
17751777
break;
17761778
case tok::equal:
17771779
// In TableGen, there must be a value after "=";
@@ -2057,11 +2059,11 @@ class AnnotatingParser {
20572059
TT_LambdaLSquare, TT_LambdaLBrace, TT_AttributeMacro, TT_IfMacro,
20582060
TT_ForEachMacro, TT_TypenameMacro, TT_FunctionLBrace,
20592061
TT_ImplicitStringLiteral, TT_InlineASMBrace, TT_FatArrow,
2060-
TT_NamespaceMacro, TT_OverloadedOperator, TT_RegexLiteral,
2061-
TT_TemplateString, TT_ObjCStringLiteral, TT_UntouchableMacroFunc,
2062-
TT_StatementAttributeLikeMacro, TT_FunctionLikeOrFreestandingMacro,
2063-
TT_ClassLBrace, TT_EnumLBrace, TT_RecordLBrace, TT_StructLBrace,
2064-
TT_UnionLBrace, TT_RequiresClause,
2062+
TT_LambdaArrow, TT_NamespaceMacro, TT_OverloadedOperator,
2063+
TT_RegexLiteral, TT_TemplateString, TT_ObjCStringLiteral,
2064+
TT_UntouchableMacroFunc, TT_StatementAttributeLikeMacro,
2065+
TT_FunctionLikeOrFreestandingMacro, TT_ClassLBrace, TT_EnumLBrace,
2066+
TT_RecordLBrace, TT_StructLBrace, TT_UnionLBrace, TT_RequiresClause,
20652067
TT_RequiresClauseInARequiresExpression, TT_RequiresExpression,
20662068
TT_RequiresExpressionLParen, TT_RequiresExpressionLBrace,
20672069
TT_BracedListLBrace)) {
@@ -2247,7 +2249,7 @@ class AnnotatingParser {
22472249
Contexts.back().IsExpression = true;
22482250
} else if (Current.is(TT_TrailingReturnArrow)) {
22492251
Contexts.back().IsExpression = false;
2250-
} else if (Current.is(Keywords.kw_assert)) {
2252+
} else if (Current.isOneOf(TT_LambdaArrow, Keywords.kw_assert)) {
22512253
Contexts.back().IsExpression = Style.Language == FormatStyle::LK_Java;
22522254
} else if (Current.Previous &&
22532255
Current.Previous->is(TT_CtorInitializerColon)) {
@@ -2382,7 +2384,7 @@ class AnnotatingParser {
23822384
AutoFound = true;
23832385
} else if (Current.is(tok::arrow) &&
23842386
Style.Language == FormatStyle::LK_Java) {
2385-
Current.setType(TT_TrailingReturnArrow);
2387+
Current.setType(TT_LambdaArrow);
23862388
} else if (Current.is(tok::arrow) && Style.isVerilog()) {
23872389
// The implication operator.
23882390
Current.setType(TT_BinaryOperator);
@@ -3288,7 +3290,7 @@ class ExpressionParser {
32883290
}
32893291
if (Current->is(TT_JsComputedPropertyName))
32903292
return prec::Assignment;
3291-
if (Current->is(TT_TrailingReturnArrow))
3293+
if (Current->is(TT_LambdaArrow))
32923294
return prec::Comma;
32933295
if (Current->is(TT_FatArrow))
32943296
return prec::Assignment;
@@ -4213,7 +4215,7 @@ unsigned TokenAnnotator::splitPenalty(const AnnotatedLine &Line,
42134215
}
42144216
if (Right.is(TT_PointerOrReference))
42154217
return 190;
4216-
if (Right.is(TT_TrailingReturnArrow))
4218+
if (Right.is(TT_LambdaArrow))
42174219
return 110;
42184220
if (Left.is(tok::equal) && Right.is(tok::l_brace))
42194221
return 160;
@@ -5293,9 +5295,10 @@ bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine &Line,
52935295
return false;
52945296
}
52955297

5296-
if (Right.is(TT_TrailingReturnArrow) || Left.is(TT_TrailingReturnArrow))
5298+
if (Right.isOneOf(TT_TrailingReturnArrow, TT_LambdaArrow) ||
5299+
Left.isOneOf(TT_TrailingReturnArrow, TT_LambdaArrow)) {
52975300
return true;
5298-
5301+
}
52995302
if (Left.is(tok::comma) && Right.isNot(TT_OverloadedOperatorLParen) &&
53005303
// In an unexpanded macro call we only find the parentheses and commas
53015304
// in a line; the commas and closing parenthesis do not require a space.
@@ -6330,8 +6333,8 @@ bool TokenAnnotator::canBreakBefore(const AnnotatedLine &Line,
63306333
return Left.isOneOf(tok::comma, tok::coloncolon, tok::semi, tok::l_brace,
63316334
tok::kw_class, tok::kw_struct, tok::comment) ||
63326335
Right.isMemberAccess() ||
6333-
Right.isOneOf(TT_TrailingReturnArrow, tok::lessless, tok::colon,
6334-
tok::l_square, tok::at) ||
6336+
Right.isOneOf(TT_TrailingReturnArrow, TT_LambdaArrow, tok::lessless,
6337+
tok::colon, tok::l_square, tok::at) ||
63356338
(Left.is(tok::r_paren) &&
63366339
Right.isOneOf(tok::identifier, tok::kw_const)) ||
63376340
(Left.is(tok::l_paren) && Right.isNot(tok::r_paren)) ||

clang/lib/Format/UnwrappedLineParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2326,7 +2326,7 @@ bool UnwrappedLineParser::tryToParseLambda() {
23262326
// This might or might not actually be a lambda arrow (this could be an
23272327
// ObjC method invocation followed by a dereferencing arrow). We might
23282328
// reset this back to TT_Unknown in TokenAnnotator.
2329-
FormatTok->setFinalizedType(TT_TrailingReturnArrow);
2329+
FormatTok->setFinalizedType(TT_LambdaArrow);
23302330
SeenArrow = true;
23312331
nextToken();
23322332
break;

clang/lib/StaticAnalyzer/Checkers/CheckPlacementNew.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ bool PlacementNewChecker::checkPlaceCapacityIsSufficient(
131131
"Storage provided to placement new is only {0} bytes, "
132132
"whereas the allocated array type requires more space for "
133133
"internal needs",
134-
SizeOfPlaceCI->getValue(), SizeOfTargetCI->getValue()));
134+
SizeOfPlaceCI->getValue()));
135135
else
136136
Msg = std::string(llvm::formatv(
137137
"Storage provided to placement new is only {0} bytes, "

clang/unittests/Format/TokenAnnotatorTest.cpp

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ class TokenAnnotatorTest : public testing::Test {
4242
EXPECT_EQ((FormatTok)->getPrecedence(), Prec) << *(FormatTok)
4343
#define EXPECT_BRACE_KIND(FormatTok, Kind) \
4444
EXPECT_EQ(FormatTok->getBlockKind(), Kind) << *(FormatTok)
45+
#define EXPECT_SPLIT_PENALTY(FormatTok, Penalty) \
46+
EXPECT_EQ(FormatTok->SplitPenalty, Penalty) << *(FormatTok)
4547
#define EXPECT_TOKEN(FormatTok, Kind, Type) \
4648
do { \
4749
EXPECT_TOKEN_KIND(FormatTok, Kind); \
@@ -1717,21 +1719,21 @@ TEST_F(TokenAnnotatorTest, UnderstandsLambdas) {
17171719
ASSERT_EQ(Tokens.size(), 9u) << Tokens;
17181720
EXPECT_TOKEN(Tokens[0], tok::l_square, TT_LambdaLSquare);
17191721
EXPECT_TOKEN(Tokens[2], tok::l_paren, TT_LambdaDefinitionLParen);
1720-
EXPECT_TOKEN(Tokens[4], tok::arrow, TT_TrailingReturnArrow);
1722+
EXPECT_TOKEN(Tokens[4], tok::arrow, TT_LambdaArrow);
17211723
EXPECT_TOKEN(Tokens[6], tok::l_brace, TT_LambdaLBrace);
17221724

17231725
Tokens = annotate("[]() -> auto & {}");
17241726
ASSERT_EQ(Tokens.size(), 10u) << Tokens;
17251727
EXPECT_TOKEN(Tokens[0], tok::l_square, TT_LambdaLSquare);
17261728
EXPECT_TOKEN(Tokens[2], tok::l_paren, TT_LambdaDefinitionLParen);
1727-
EXPECT_TOKEN(Tokens[4], tok::arrow, TT_TrailingReturnArrow);
1729+
EXPECT_TOKEN(Tokens[4], tok::arrow, TT_LambdaArrow);
17281730
EXPECT_TOKEN(Tokens[7], tok::l_brace, TT_LambdaLBrace);
17291731

17301732
Tokens = annotate("[]() -> auto * {}");
17311733
ASSERT_EQ(Tokens.size(), 10u) << Tokens;
17321734
EXPECT_TOKEN(Tokens[0], tok::l_square, TT_LambdaLSquare);
17331735
EXPECT_TOKEN(Tokens[2], tok::l_paren, TT_LambdaDefinitionLParen);
1734-
EXPECT_TOKEN(Tokens[4], tok::arrow, TT_TrailingReturnArrow);
1736+
EXPECT_TOKEN(Tokens[4], tok::arrow, TT_LambdaArrow);
17351737
EXPECT_TOKEN(Tokens[7], tok::l_brace, TT_LambdaLBrace);
17361738

17371739
Tokens = annotate("[] {}");
@@ -1747,20 +1749,20 @@ TEST_F(TokenAnnotatorTest, UnderstandsLambdas) {
17471749
Tokens = annotate("[] -> auto {}");
17481750
ASSERT_EQ(Tokens.size(), 7u) << Tokens;
17491751
EXPECT_TOKEN(Tokens[0], tok::l_square, TT_LambdaLSquare);
1750-
EXPECT_TOKEN(Tokens[2], tok::arrow, TT_TrailingReturnArrow);
1752+
EXPECT_TOKEN(Tokens[2], tok::arrow, TT_LambdaArrow);
17511753
EXPECT_TOKEN(Tokens[4], tok::l_brace, TT_LambdaLBrace);
17521754

17531755
Tokens = annotate("[] -> struct S { return {}; }");
17541756
ASSERT_EQ(Tokens.size(), 12u) << Tokens;
17551757
EXPECT_TOKEN(Tokens[0], tok::l_square, TT_LambdaLSquare);
1756-
EXPECT_TOKEN(Tokens[2], tok::arrow, TT_TrailingReturnArrow);
1758+
EXPECT_TOKEN(Tokens[2], tok::arrow, TT_LambdaArrow);
17571759
EXPECT_TOKEN(Tokens[5], tok::l_brace, TT_LambdaLBrace);
17581760

17591761
Tokens = annotate("foo([&](u32 bar) __attribute__((attr)) -> void {});");
17601762
ASSERT_EQ(Tokens.size(), 22u) << Tokens;
17611763
EXPECT_TOKEN(Tokens[2], tok::l_square, TT_LambdaLSquare);
17621764
EXPECT_TOKEN(Tokens[5], tok::l_paren, TT_LambdaDefinitionLParen);
1763-
EXPECT_TOKEN(Tokens[15], tok::arrow, TT_TrailingReturnArrow);
1765+
EXPECT_TOKEN(Tokens[15], tok::arrow, TT_LambdaArrow);
17641766
EXPECT_TOKEN(Tokens[17], tok::l_brace, TT_LambdaLBrace);
17651767

17661768
Tokens = annotate("[] <typename T> () {}");
@@ -1849,7 +1851,7 @@ TEST_F(TokenAnnotatorTest, UnderstandsLambdas) {
18491851
EXPECT_TOKEN(Tokens[0], tok::l_square, TT_LambdaLSquare);
18501852
EXPECT_TOKEN(Tokens[2], tok::less, TT_TemplateOpener);
18511853
EXPECT_TOKEN(Tokens[6], tok::l_paren, TT_LambdaDefinitionLParen);
1852-
EXPECT_TOKEN(Tokens[10], tok::arrow, TT_TrailingReturnArrow);
1854+
EXPECT_TOKEN(Tokens[10], tok::arrow, TT_LambdaArrow);
18531855
EXPECT_TOKEN(Tokens[12], tok::kw_requires, TT_RequiresClause);
18541856
EXPECT_TRUE(Tokens[16]->ClosesRequiresClause);
18551857
EXPECT_TOKEN(Tokens[17], tok::l_brace, TT_LambdaLBrace);
@@ -1918,7 +1920,7 @@ TEST_F(TokenAnnotatorTest, UnderstandsLambdas) {
19181920
EXPECT_TOKEN(Tokens[2], tok::less, TT_TemplateOpener);
19191921
EXPECT_TOKEN(Tokens[6], tok::kw_requires, TT_RequiresClause);
19201922
EXPECT_TRUE(Tokens[10]->ClosesRequiresClause);
1921-
EXPECT_TOKEN(Tokens[11], tok::arrow, TT_TrailingReturnArrow);
1923+
EXPECT_TOKEN(Tokens[11], tok::arrow, TT_LambdaArrow);
19221924
EXPECT_TOKEN(Tokens[13], tok::l_brace, TT_LambdaLBrace);
19231925

19241926
Tokens = annotate("[] <typename T> requires Foo<T> (T t) requires Bar<T> {}");
@@ -3359,7 +3361,7 @@ TEST_F(TokenAnnotatorTest, FunctionTryBlock) {
33593361
EXPECT_TOKEN(Tokens[3], tok::l_paren, TT_FunctionDeclarationLParen);
33603362
EXPECT_TOKEN(Tokens[11], tok::colon, TT_CtorInitializerColon);
33613363
EXPECT_TOKEN(Tokens[14], tok::l_square, TT_LambdaLSquare);
3362-
EXPECT_TOKEN(Tokens[16], tok::arrow, TT_TrailingReturnArrow);
3364+
EXPECT_TOKEN(Tokens[16], tok::arrow, TT_LambdaArrow);
33633365
EXPECT_TOKEN(Tokens[20], tok::l_brace, TT_LambdaLBrace);
33643366
EXPECT_TOKEN(Tokens[31], tok::comma, TT_CtorInitializerComma);
33653367
EXPECT_TOKEN(Tokens[36], tok::l_brace, TT_FunctionLBrace);
@@ -3386,6 +3388,20 @@ TEST_F(TokenAnnotatorTest, GNULanguageStandard) {
33863388
EXPECT_TOKEN(Tokens[2], tok::spaceship, TT_BinaryOperator);
33873389
}
33883390

3391+
TEST_F(TokenAnnotatorTest, SplitPenalty) {
3392+
auto Style = getLLVMStyle();
3393+
Style.ColumnLimit = 20;
3394+
3395+
auto Tokens = annotate("class foo {\n"
3396+
" auto bar()\n"
3397+
" -> bool;\n"
3398+
"};",
3399+
Style);
3400+
ASSERT_EQ(Tokens.size(), 13u) << Tokens;
3401+
EXPECT_TOKEN(Tokens[7], tok::arrow, TT_TrailingReturnArrow);
3402+
EXPECT_SPLIT_PENALTY(Tokens[7], 23u);
3403+
}
3404+
33893405
} // namespace
33903406
} // namespace format
33913407
} // namespace clang

lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ DWARFUnit::GetDIE(dw_offset_t die_offset) {
655655

656656
if (!ContainsDIEOffset(die_offset)) {
657657
GetSymbolFileDWARF().GetObjectFile()->GetModule()->ReportError(
658-
"GetDIE for DIE {0:x16} is outside of its CU {0:x16}", die_offset,
658+
"GetDIE for DIE {0:x16} is outside of its CU {1:x16}", die_offset,
659659
GetOffset());
660660
return DWARFDIE(); // Not found
661661
}

llvm/docs/CommandGuide/llvm-profdata.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,12 @@ OPTIONS
162162
coverage for the optimized target. This option can only be used with
163163
sample-based profile in extbinary format.
164164

165+
.. option:: --split-layout=[true|false]
166+
167+
Split the profile data section to two with one containing sample profiles with
168+
inlined functions and the other not. This option can only be used with
169+
sample-based profile in extbinary format.
170+
165171
.. option:: --convert-sample-profile-layout=[nest|flat]
166172

167173
Convert the merged profile into a profile with a new layout. Supported

llvm/include/llvm/Config/llvm-config.h.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
/* Indicate that this is LLVM compiled from the amd-gfx branch. */
1818
#define LLVM_HAVE_BRANCH_AMD_GFX
19-
#define LLVM_MAIN_REVISION 509959
19+
#define LLVM_MAIN_REVISION 509964
2020

2121
/* Define if LLVM_ENABLE_DUMP is enabled */
2222
#cmakedefine LLVM_ENABLE_DUMP

llvm/include/llvm/ProfileData/SampleProfReader.h

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -495,9 +495,9 @@ class SampleProfileReader {
495495
/// are present.
496496
virtual void setProfileUseMD5() { ProfileIsMD5 = true; }
497497

498-
/// Don't read profile without context if the flag is set. This is only meaningful
499-
/// for ExtBinary format.
500-
virtual void setSkipFlatProf(bool Skip) {}
498+
/// Don't read profile without context if the flag is set.
499+
void setSkipFlatProf(bool Skip) { SkipFlatProf = Skip; }
500+
501501
/// Return whether any name in the profile contains ".__uniq." suffix.
502502
virtual bool hasUniqSuffix() { return false; }
503503

@@ -581,6 +581,10 @@ class SampleProfileReader {
581581
/// Whether the profile uses MD5 for Sample Contexts and function names. This
582582
/// can be one-way overriden by the user to force use MD5.
583583
bool ProfileIsMD5 = false;
584+
585+
/// If SkipFlatProf is true, skip functions marked with !Flat in text mode or
586+
/// sections with SecFlagFlat flag in ExtBinary mode.
587+
bool SkipFlatProf = false;
584588
};
585589

586590
class SampleProfileReaderText : public SampleProfileReader {
@@ -789,10 +793,6 @@ class SampleProfileReaderExtBinaryBase : public SampleProfileReaderBinary {
789793
/// The set containing the functions to use when compiling a module.
790794
DenseSet<StringRef> FuncsToUse;
791795

792-
/// If SkipFlatProf is true, skip the sections with
793-
/// SecFlagFlat flag.
794-
bool SkipFlatProf = false;
795-
796796
public:
797797
SampleProfileReaderExtBinaryBase(std::unique_ptr<MemoryBuffer> B,
798798
LLVMContext &C, SampleProfileFormat Format)
@@ -815,8 +815,6 @@ class SampleProfileReaderExtBinaryBase : public SampleProfileReaderBinary {
815815
return std::move(ProfSymList);
816816
};
817817

818-
void setSkipFlatProf(bool Skip) override { SkipFlatProf = Skip; }
819-
820818
private:
821819
/// Read the profiles on-demand for the given functions. This is used after
822820
/// stale call graph matching finds new functions whose profiles aren't loaded

0 commit comments

Comments
 (0)