Skip to content

Commit 856c22e

Browse files
committed
Convert SpecialCaseList::Sections from StringMap to vector.
Created using spr 1.3.6
2 parents 59d910d + 7e690db commit 856c22e

File tree

607 files changed

+8113
-18415
lines changed

Some content is hidden

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

607 files changed

+8113
-18415
lines changed

bolt/include/bolt/Profile/Heatmap.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ class Heatmap {
5252
: BucketSize(BucketSize), MinAddress(MinAddress), MaxAddress(MaxAddress),
5353
TextSections(TextSections) {}
5454

55-
uint64_t HotStart{0};
56-
uint64_t HotEnd{0};
57-
5855
inline bool ignoreAddress(uint64_t Address) const {
5956
return (Address > MaxAddress) || (Address < MinAddress);
6057
}

bolt/lib/Profile/DataAggregator.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,14 +1316,6 @@ std::error_code DataAggregator::printLBRHeatMap() {
13161316
}
13171317
Heatmap HM(opts::HeatmapBlock, opts::HeatmapMinAddress,
13181318
opts::HeatmapMaxAddress, getTextSections(BC));
1319-
auto getSymbolValue = [&](const MCSymbol *Symbol) -> uint64_t {
1320-
if (Symbol)
1321-
if (ErrorOr<uint64_t> SymValue = BC->getSymbolValue(*Symbol))
1322-
return SymValue.get();
1323-
return 0;
1324-
};
1325-
HM.HotStart = getSymbolValue(BC->getHotTextStartSymbol());
1326-
HM.HotEnd = getSymbolValue(BC->getHotTextEndSymbol());
13271319

13281320
if (!NumTotalSamples) {
13291321
if (opts::BasicAggregation) {

bolt/lib/Profile/Heatmap.cpp

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
#include "bolt/Profile/Heatmap.h"
1010
#include "bolt/Utils/CommandLineOpts.h"
11-
#include "llvm/ADT/AddressRanges.h"
1211
#include "llvm/ADT/StringMap.h"
1312
#include "llvm/ADT/Twine.h"
1413
#include "llvm/Support/Debug.h"
@@ -314,9 +313,6 @@ void Heatmap::printSectionHotness(raw_ostream &OS) const {
314313
UnmappedHotness += Frequency;
315314
};
316315

317-
AddressRange HotTextRange(HotStart, HotEnd);
318-
StringRef HotTextName = "[hot text]";
319-
320316
for (const std::pair<const uint64_t, uint64_t> &KV : Map) {
321317
NumTotalCounts += KV.second;
322318
// We map an address bucket to the first section (lowest address)
@@ -332,24 +328,15 @@ void Heatmap::printSectionHotness(raw_ostream &OS) const {
332328
}
333329
SectionHotness[TextSections[TextSectionIndex].Name] += KV.second;
334330
++BucketUtilization[TextSections[TextSectionIndex].Name];
335-
if (HotTextRange.contains(Address)) {
336-
SectionHotness[HotTextName] += KV.second;
337-
++BucketUtilization[HotTextName];
338-
}
339331
}
340332

341-
std::vector<SectionNameAndRange> Sections(TextSections);
342-
// Append synthetic hot text section to TextSections
343-
if (!HotTextRange.empty())
344-
Sections.emplace_back(SectionNameAndRange{HotTextName, HotStart, HotEnd});
345-
346333
assert(NumTotalCounts > 0 &&
347334
"total number of heatmap buckets should be greater than 0");
348335

349336
OS << "Section Name, Begin Address, End Address, Percentage Hotness, "
350337
<< "Utilization Pct, Partition Score\n";
351338
const uint64_t MappedCounts = NumTotalCounts - UnmappedHotness;
352-
for (const auto [Name, Begin, End] : Sections) {
339+
for (const auto [Name, Begin, End] : TextSections) {
353340
const float Hotness = 1. * SectionHotness[Name] / NumTotalCounts;
354341
const float MappedHotness =
355342
MappedCounts ? 1. * SectionHotness[Name] / MappedCounts : 0;

bolt/lib/Rewrite/RewriteInstance.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -968,9 +968,8 @@ void RewriteInstance::discoverFileObjects() {
968968
continue;
969969
}
970970

971-
// Ignore input hot markers unless in heatmap mode
972-
if ((SymName == "__hot_start" || SymName == "__hot_end") &&
973-
!opts::HeatmapMode)
971+
// Ignore input hot markers
972+
if (SymName == "__hot_start" || SymName == "__hot_end")
974973
continue;
975974

976975
FileSymRefs.emplace(SymbolAddress, Symbol);

bolt/test/X86/callcont-fallthru.s

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# RUN: %clangxx %cxxflags %s %t.so -o %t -Wl,-q -nostdlib
77
# RUN: link_fdata %s %t %t.pat PREAGGT1
88
# RUN: link_fdata %s %t %t.pat2 PREAGGT2
9-
# RUN-DISABLED: link_fdata %s %t %t.patplt PREAGGPLT
9+
# RUN: link_fdata %s %t %t.patplt PREAGGPLT
1010

1111
# RUN: llvm-strip --strip-unneeded %t -o %t.strip
1212
# RUN: llvm-objcopy --remove-section=.eh_frame %t.strip %t.noeh
@@ -26,8 +26,8 @@
2626

2727
## Check pre-aggregated traces don't report zero-sized PLT fall-through as
2828
## invalid trace
29-
# RUN-DISABLED: llvm-bolt %t.strip --pa -p %t.patplt -o %t.out | FileCheck %s \
30-
# RUN-DISABLED: --check-prefix=CHECK-PLT
29+
# RUN: llvm-bolt %t.strip --pa -p %t.patplt -o %t.out | FileCheck %s \
30+
# RUN: --check-prefix=CHECK-PLT
3131
# CHECK-PLT: traces mismatching disassembled function contents: 0
3232

3333
.globl foo

bolt/test/X86/heatmap-preagg.test

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ RUN: --reorder-functions=cdsort --enable-bat --dyno-stats --skip-funcs=main
1313
RUN: llvm-bolt-heatmap %t.out -o %t2 --pa -p %p/Inputs/blarge_new_bat.preagg.txt \
1414
RUN: 2>&1 | FileCheck --check-prefix CHECK-HEATMAP-BAT %s
1515
RUN: FileCheck %s --check-prefix CHECK-SEC-HOT-BAT --input-file %t2-section-hotness.csv
16-
RUN: llvm-nm -n %t.out | FileCheck %s --check-prefix=CHECK-HOT-SYMS
1716

1817
CHECK-HEATMAP: PERF2BOLT: read 81 aggregated LBR entries
1918
CHECK-HEATMAP: HEATMAP: invalid traces: 1
@@ -34,6 +33,3 @@ CHECK-SEC-HOT-BAT-NEXT: .bolt.org.text, 0x4010b0, 0x401c25, 38.3385, 51.0638, 0.
3433
CHECK-SEC-HOT-BAT-NEXT: .fini, 0x401c28, 0x401c35, 0.0000, 0.0000, 0.0000
3534
CHECK-SEC-HOT-BAT-NEXT: .text, 0x800000, 0x8002cc, 38.7595, 91.6667, 0.3553
3635
CHECK-SEC-HOT-BAT-NEXT: .text.cold, 0x800300, 0x800415, 0.0000, 0.0000, 0.0000
37-
CHECK-SEC-HOT-BAT-NEXT: [hot text], 0x800000, 0x8002cc, 38.7595, 91.6667, 0.3553
38-
CHECK-HOT-SYMS: 800000 W __hot_start
39-
CHECK-HOT-SYMS: 8002cc W __hot_end

clang/docs/CMakeLists.txt

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -134,34 +134,6 @@ if (LLVM_ENABLE_SPHINX)
134134
gen_rst_file_from_td(DiagnosticsReference.rst -gen-diag-docs ../include/clang/Basic/Diagnostic.td "${docs_targets}")
135135
gen_rst_file_from_td(ClangCommandLineReference.rst -gen-opt-docs ../include/clang/Driver/ClangOptionDocs.td "${docs_targets}")
136136

137-
# Another generated file from a different source
138-
set(docs_tools_dir ${CMAKE_CURRENT_SOURCE_DIR}/tools)
139-
set(aopts_rst_rel_path analyzer/user-docs/Options.rst)
140-
set(aopts_rst "${CMAKE_CURRENT_BINARY_DIR}/${aopts_rst_rel_path}")
141-
set(analyzeroptions_def "${CMAKE_CURRENT_SOURCE_DIR}/../include/clang/StaticAnalyzer/Core/AnalyzerOptions.def")
142-
set(aopts_rst_in "${CMAKE_CURRENT_SOURCE_DIR}/${aopts_rst_rel_path}.in")
143-
add_custom_command(
144-
OUTPUT ${aopts_rst}
145-
COMMAND ${Python3_EXECUTABLE} generate_analyzer_options_docs.py
146-
--options-def "${analyzeroptions_def}"
147-
--template "${aopts_rst_in}"
148-
--out "${aopts_rst}"
149-
WORKING_DIRECTORY ${docs_tools_dir}
150-
VERBATIM
151-
COMMENT "Generating ${aopts_rst}"
152-
DEPENDS ${docs_tools_dir}/${generate_aopts_docs}
153-
${aopts_rst_in}
154-
copy-clang-rst-docs
155-
)
156-
add_custom_target(generate-analyzer-options-rst DEPENDS ${aopts_rst})
157-
foreach(target ${docs_targets})
158-
add_dependencies(${target} generate-analyzer-options-rst)
159-
endforeach()
160-
161-
# Technically this is redundant because generate-analyzer-options-rst
162-
# depends on the copy operation (because it wants to drop a generated file
163-
# into a subdirectory of the copied tree), but I'm leaving it here for the
164-
# sake of clarity.
165137
foreach(target ${docs_targets})
166138
add_dependencies(${target} copy-clang-rst-docs)
167139
endforeach()

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -520,36 +520,19 @@ Improvements to Clang's diagnostics
520520
- Several compatibility diagnostics that were incorrectly being grouped under
521521
``-Wpre-c++20-compat`` are now part of ``-Wc++20-compat``. (#GH138775)
522522

523-
- Improved the ``-Wtautological-overlap-compare`` diagnostics to warn about overlapping and non-overlapping ranges involving character literals and floating-point literals.
523+
- Improved the ``-Wtautological-overlap-compare`` diagnostics to warn about overlapping and non-overlapping ranges involving character literals and floating-point literals.
524524
The warning message for non-overlapping cases has also been improved (#GH13473).
525525

526526
- Fixed a duplicate diagnostic when performing typo correction on function template
527527
calls with explicit template arguments. (#GH139226)
528-
528+
529529
- Explanatory note is printed when ``assert`` fails during evaluation of a
530530
constant expression. Prior to this, the error inaccurately implied that assert
531531
could not be used at all in a constant expression (#GH130458)
532532

533533
- A new off-by-default warning ``-Wms-bitfield-padding`` has been added to alert to cases where bit-field
534534
packing may differ under the MS struct ABI (#GH117428).
535535

536-
- ``-Watomic-access`` no longer fires on unreachable code. e.g.,
537-
538-
.. code-block:: c
539-
540-
_Atomic struct S { int a; } s;
541-
void func(void) {
542-
if (0)
543-
s.a = 12; // Previously diagnosed with -Watomic-access, now silenced
544-
s.a = 12; // Still diagnosed with -Watomic-access
545-
return;
546-
s.a = 12; // Previously diagnosed, now silenced
547-
}
548-
549-
550-
- A new ``-Wcharacter-conversion`` warns where comparing or implicitly converting
551-
between different Unicode character types (``char8_t``, ``char16_t``, ``char32_t``).
552-
This warning only triggers in C++ as these types are aliases in C. (#GH138526)
553536

554537
Improvements to Clang's time-trace
555538
----------------------------------
@@ -614,7 +597,6 @@ Bug Fixes in This Version
614597
- Fixed a crash with an invalid member function parameter list with a default
615598
argument which contains a pragma. (#GH113722)
616599
- Fixed assertion failures when generating name lookup table in modules. (#GH61065, #GH134739)
617-
- Fixed an assertion failure in constant compound literal statements. (#GH139160)
618600

619601
Bug Fixes to Compiler Builtins
620602
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -727,8 +709,6 @@ Bug Fixes to C++ Support
727709
- Fixed the handling of pack indexing types in the constraints of a member function redeclaration. (#GH138255)
728710
- Clang now correctly parses arbitrary order of ``[[]]``, ``__attribute__`` and ``alignas`` attributes for declarations (#GH133107)
729711
- Fixed a crash when forming an invalid function type in a dependent context. (#GH138657) (#GH115725) (#GH68852)
730-
- Clang no longer segfaults when there is a configuration mismatch between modules and their users (http://crbug.com/400353616).
731-
- Fix an incorrect deduction when calling an explicit object member function template through an overload set address.
732712

733713
Bug Fixes to AST Handling
734714
^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -877,11 +857,6 @@ clang-format
877857
- Add ``OneLineFormatOffRegex`` option for turning formatting off for one line.
878858
- Add ``SpaceAfterOperatorKeyword`` option.
879859

880-
clang-refactor
881-
--------------
882-
- Reject `0` as column or line number in 1-based command-line source locations.
883-
Fixes crash caused by `0` input in `-selection=<file>:<line>:<column>[-<line>:<column>]`. (#GH139457)
884-
885860
libclang
886861
--------
887862
- Fixed a bug in ``clang_File_isEqual`` that sometimes led to different
@@ -900,8 +875,6 @@ libclang
900875

901876
Code Completion
902877
---------------
903-
- Reject `0` as column or line number in 1-based command-line source locations.
904-
Fixes crash caused by `0` input in `-code-completion-at=<file>:<line>:<column>`. (#GH139457)
905878

906879
Static Analyzer
907880
---------------

clang/docs/analyzer/user-docs.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Contents:
88

99
user-docs/Installation
1010
user-docs/CommandLineUsage
11-
user-docs/Options
1211
user-docs/UsingWithXCode
1312
user-docs/FilingBugs
1413
user-docs/CrossTranslationUnit

clang/docs/analyzer/user-docs/CommandLineUsage.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,6 @@ When compiling your application to run on the simulator, it is important that **
194194

195195
If you aren't certain which compiler Xcode uses to build your project, try just running ``xcodebuild`` (without **scan-build**). You should see the full path to the compiler that Xcode is using, and use that as an argument to ``--use-cc``.
196196

197-
.. _command-line-usage-CodeChecker:
198-
199197
CodeChecker
200198
-----------
201199

0 commit comments

Comments
 (0)