Skip to content

Commit 898a5fc

Browse files
Merge branch 'main' into ldstpair
2 parents b18f3a6 + 1f99a45 commit 898a5fc

File tree

891 files changed

+50600
-27891
lines changed

Some content is hidden

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

891 files changed

+50600
-27891
lines changed

.ci/generate-buildkite-pipeline-premerge

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,7 @@ linux_projects=$(add-dependencies ${linux_projects_to_test} | sort | uniq)
233233

234234
windows_projects_to_test=$(exclude-windows $(compute-projects-to-test ${modified_projects}))
235235
windows_check_targets=$(check-targets ${windows_projects_to_test} | sort | uniq)
236-
# Temporary disable the windows job.
237-
# See https://discourse.llvm.org/t/rfc-future-of-windows-pre-commit-ci/76840
238-
#windows_projects=$(add-dependencies ${windows_projects_to_test} | sort | uniq)
239-
windows_projects=""
236+
windows_projects=$(add-dependencies ${windows_projects_to_test} | sort | uniq)
240237

241238
# Generate the appropriate pipeline
242239
if [[ "${linux_projects}" != "" ]]; then

.ci/monolithic-windows.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ targets="${2}"
3838

3939
echo "--- cmake"
4040
pip install -q -r ${MONOREPO_ROOT}/mlir/python/requirements.txt
41+
42+
# The CMAKE_*_LINKER_FLAGS to disable the manifest come from research
43+
# on fixing a build reliability issue on the build server, please
44+
# see https://github.com/llvm/llvm-project/pull/82393 and
45+
# https://discourse.llvm.org/t/rfc-future-of-windows-pre-commit-ci/76840/40
46+
# for further information.
4147
cmake -S ${MONOREPO_ROOT}/llvm -B ${BUILD_DIR} \
4248
-D LLVM_ENABLE_PROJECTS="${projects}" \
4349
-G Ninja \
@@ -49,7 +55,10 @@ cmake -S ${MONOREPO_ROOT}/llvm -B ${BUILD_DIR} \
4955
-D COMPILER_RT_BUILD_ORC=OFF \
5056
-D CMAKE_C_COMPILER_LAUNCHER=sccache \
5157
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache \
52-
-D MLIR_ENABLE_BINDINGS_PYTHON=ON
58+
-D MLIR_ENABLE_BINDINGS_PYTHON=ON \
59+
-D CMAKE_EXE_LINKER_FLAGS="/MANIFEST:NO" \
60+
-D CMAKE_MODULE_LINKER_FLAGS="/MANIFEST:NO" \
61+
-D CMAKE_SHARED_LINKER_FLAGS="/MANIFEST:NO"
5362

5463
echo "--- ninja"
5564
# Targets are not escaped as they are passed as separate arguments.

.github/workflows/release-tasks.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
name: Create a New Release
2929
runs-on: ubuntu-latest
3030
needs: validate-tag
31+
3132
steps:
3233
- name: Install Dependencies
3334
run: |
@@ -40,8 +41,9 @@ jobs:
4041
- name: Create Release
4142
env:
4243
GITHUB_TOKEN: ${{ github.token }}
44+
USER_TOKEN: ${{ secrets.RELEASE_TASKS_USER_TOKEN }}
4345
run: |
44-
./llvm/utils/release/./github-upload-release.py --token "$GITHUB_TOKEN" --release ${{ needs.validate-tag.outputs.release-version }} --user ${{ github.actor }} create
46+
./llvm/utils/release/./github-upload-release.py --token "$GITHUB_TOKEN" --release ${{ needs.validate-tag.outputs.release-version }} --user ${{ github.actor }} --user-token "$USER_TOKEN" create
4547
release-documentation:
4648
name: Build and Upload Release Documentation
4749
needs:

bolt/include/bolt/Core/BinarySection.h

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,7 @@ class BinarySection {
139139
Alignment = NewAlignment;
140140
ELFType = NewELFType;
141141
ELFFlags = NewELFFlags;
142-
OutputSize = NewSize;
143-
OutputContents = StringRef(reinterpret_cast<const char *>(NewData),
144-
NewData ? NewSize : 0);
145-
IsFinalized = true;
142+
updateContents(NewData, NewSize);
146143
}
147144

148145
public:
@@ -484,9 +481,18 @@ class BinarySection {
484481
void flushPendingRelocations(raw_pwrite_stream &OS,
485482
SymbolResolverFuncTy Resolver);
486483

487-
/// Change contents of the section.
488-
void updateContents(const uint8_t *Data, size_t NewSize) {
489-
OutputContents = StringRef(reinterpret_cast<const char *>(Data), NewSize);
484+
/// Change contents of the section. Unless the section has a valid SectionID,
485+
/// the memory passed in \p NewData will be managed by the instance of
486+
/// BinarySection.
487+
void updateContents(const uint8_t *NewData, size_t NewSize) {
488+
if (getOutputData() && !hasValidSectionID() &&
489+
(!hasSectionRef() ||
490+
OutputContents.data() != getContentsOrQuit(Section).data())) {
491+
delete[] getOutputData();
492+
}
493+
494+
OutputContents = StringRef(reinterpret_cast<const char *>(NewData),
495+
NewData ? NewSize : 0);
490496
OutputSize = NewSize;
491497
IsFinalized = true;
492498
}

bolt/include/bolt/Core/DIEBuilder.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class DIEBuilder {
124124
std::vector<std::unique_ptr<DIEAbbrev>> Abbreviations;
125125
BinaryContext &BC;
126126
DWARFContext *DwarfContext{nullptr};
127-
bool IsDWO{false};
127+
DWARFUnit *SkeletonCU{nullptr};
128128
uint64_t UnitSize{0};
129129
llvm::DenseSet<uint64_t> AllProcessed;
130130

@@ -264,8 +264,12 @@ class DIEBuilder {
264264
/// current Section.
265265
DIE *constructDIEFast(DWARFDie &DDie, DWARFUnit &U, uint32_t UnitId);
266266

267+
/// Returns true if this DIEBUilder is for DWO Unit.
268+
bool isDWO() const { return SkeletonCU != nullptr; }
269+
267270
public:
268-
DIEBuilder(BinaryContext &BC, DWARFContext *DwarfContext, bool IsDWO = false);
271+
DIEBuilder(BinaryContext &BC, DWARFContext *DwarfContext,
272+
DWARFUnit *SkeletonCU = nullptr);
269273

270274
/// Returns enum to what we are currently processing.
271275
ProcessingType getCurrentProcessingState() { return getState().Type; }

bolt/include/bolt/Core/DebugData.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,10 +450,16 @@ class DebugStrOffsetsWriter {
450450
return std::move(StrOffsetsBuffer);
451451
}
452452

453-
private:
454453
/// Initializes Buffer and Stream.
455454
void initialize(DWARFUnit &Unit);
456455

456+
/// Clear data.
457+
void clear() {
458+
IndexToAddressMap.clear();
459+
StrOffsets.clear();
460+
}
461+
462+
private:
457463
std::unique_ptr<DebugStrOffsetsBufferVector> StrOffsetsBuffer;
458464
std::unique_ptr<raw_svector_ostream> StrOffsetsStream;
459465
std::map<uint32_t, uint32_t> IndexToAddressMap;

bolt/lib/Core/BinarySection.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -190,18 +190,7 @@ void BinarySection::flushPendingRelocations(raw_pwrite_stream &OS,
190190
clearList(PendingRelocations);
191191
}
192192

193-
BinarySection::~BinarySection() {
194-
if (isReordered()) {
195-
delete[] getData();
196-
return;
197-
}
198-
199-
if (!isAllocatable() && !hasValidSectionID() &&
200-
(!hasSectionRef() ||
201-
OutputContents.data() != getContentsOrQuit(Section).data())) {
202-
delete[] getOutputData();
203-
}
204-
}
193+
BinarySection::~BinarySection() { updateContents(nullptr, 0); }
205194

206195
void BinarySection::clearRelocations() { clearList(Relocations); }
207196

bolt/lib/Core/DIEBuilder.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ void DIEBuilder::constructFromUnit(DWARFUnit &DU) {
179179
}
180180

181181
DIEBuilder::DIEBuilder(BinaryContext &BC, DWARFContext *DwarfContext,
182-
bool IsDWO)
183-
: BC(BC), DwarfContext(DwarfContext), IsDWO(IsDWO) {}
182+
DWARFUnit *SkeletonCU)
183+
: BC(BC), DwarfContext(DwarfContext), SkeletonCU(SkeletonCU) {}
184184

185185
static unsigned int getCUNum(DWARFContext *DwarfContext, bool IsDWO) {
186186
unsigned int CUNum = IsDWO ? DwarfContext->getNumDWOCompileUnits()
@@ -204,11 +204,11 @@ void DIEBuilder::buildTypeUnits(DebugStrOffsetsWriter *StrOffsetWriter,
204204
true);
205205
}
206206
}
207-
const unsigned int CUNum = getCUNum(DwarfContext, IsDWO);
207+
const unsigned int CUNum = getCUNum(DwarfContext, isDWO());
208208
getState().CloneUnitCtxMap.resize(CUNum);
209209
DWARFContext::unit_iterator_range CU4TURanges =
210-
IsDWO ? DwarfContext->dwo_types_section_units()
211-
: DwarfContext->types_section_units();
210+
isDWO() ? DwarfContext->dwo_types_section_units()
211+
: DwarfContext->types_section_units();
212212

213213
getState().Type = ProcessingType::DWARF4TUs;
214214
for (std::unique_ptr<DWARFUnit> &DU : CU4TURanges)
@@ -218,8 +218,8 @@ void DIEBuilder::buildTypeUnits(DebugStrOffsetsWriter *StrOffsetWriter,
218218
constructFromUnit(*DU.get());
219219

220220
DWARFContext::unit_iterator_range CURanges =
221-
IsDWO ? DwarfContext->dwo_info_section_units()
222-
: DwarfContext->info_section_units();
221+
isDWO() ? DwarfContext->dwo_info_section_units()
222+
: DwarfContext->info_section_units();
223223

224224
// This handles DWARF4 CUs and DWARF5 CU/TUs.
225225
// Creating a vector so that for reference handling only DWARF5 CU/TUs are
@@ -242,11 +242,11 @@ void DIEBuilder::buildCompileUnits(const bool Init) {
242242
if (Init)
243243
BuilderState.reset(new State());
244244

245-
unsigned int CUNum = getCUNum(DwarfContext, IsDWO);
245+
unsigned int CUNum = getCUNum(DwarfContext, isDWO());
246246
getState().CloneUnitCtxMap.resize(CUNum);
247247
DWARFContext::unit_iterator_range CURanges =
248-
IsDWO ? DwarfContext->dwo_info_section_units()
249-
: DwarfContext->info_section_units();
248+
isDWO() ? DwarfContext->dwo_info_section_units()
249+
: DwarfContext->info_section_units();
250250

251251
// This handles DWARF4 CUs and DWARF5 CU/TUs.
252252
// Creating a vector so that for reference handling only DWARF5 CU/TUs are

bolt/lib/Core/DebugData.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -909,8 +909,7 @@ void DebugStrOffsetsWriter::finalizeSection(DWARFUnit &Unit,
909909
}
910910

911911
StrOffsetSectionWasModified = false;
912-
IndexToAddressMap.clear();
913-
StrOffsets.clear();
912+
clear();
914913
}
915914

916915
void DebugStrWriter::create() {

bolt/lib/Rewrite/DWARFRewriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ void DWARFRewriter::updateDebugInfo() {
709709
: LegacyRangesSectionWriter.get();
710710
// Skipping CUs that failed to load.
711711
if (SplitCU) {
712-
DIEBuilder DWODIEBuilder(BC, &(*SplitCU)->getContext(), true);
712+
DIEBuilder DWODIEBuilder(BC, &(*SplitCU)->getContext(), Unit);
713713
DWODIEBuilder.buildDWOUnit(**SplitCU);
714714
std::string DWOName = updateDWONameCompDir(
715715
*Unit, *DIEBlder, *DIEBlder->getUnitDIEbyUnit(*Unit));

bolt/lib/Rewrite/RewriteInstance.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4092,12 +4092,9 @@ void RewriteInstance::rewriteNoteSections() {
40924092
return getNewValueForSymbol(S->getName());
40934093
});
40944094

4095-
// Set/modify section info.
4096-
BinarySection &NewSection = BC->registerOrUpdateNoteSection(
4097-
SectionName, SectionData, Size, Section.sh_addralign,
4098-
!BSec->isWritable(), BSec->getELFType());
4099-
NewSection.setOutputAddress(0);
4100-
NewSection.setOutputFileOffset(NextAvailableOffset);
4095+
// Section contents are no longer needed, but we need to update the size so
4096+
// that it will be reflected in the section header table.
4097+
BSec->updateContents(nullptr, Size);
41014098

41024099
NextAvailableOffset += Size;
41034100
}

bolt/unittests/Core/BinaryContext.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,11 @@ TEST_P(BinaryContextTester, FlushPendingRelocCALL26) {
7777
// 12: bl func2
7878
// 16: func2
7979

80-
char Data[20] = {};
80+
constexpr size_t DataSize = 20;
81+
uint8_t *Data = new uint8_t[DataSize];
8182
BinarySection &BS = BC->registerOrUpdateSection(
82-
".text", ELF::SHT_PROGBITS, ELF::SHF_EXECINSTR | ELF::SHF_ALLOC,
83-
(uint8_t *)Data, sizeof(Data), 4);
83+
".text", ELF::SHT_PROGBITS, ELF::SHF_EXECINSTR | ELF::SHF_ALLOC, Data,
84+
DataSize, 4);
8485
MCSymbol *RelSymbol1 = BC->getOrCreateGlobalSymbol(4, "Func1");
8586
ASSERT_TRUE(RelSymbol1);
8687
BS.addRelocation(8, RelSymbol1, ELF::R_AARCH64_CALL26, 0, 0, true);
@@ -89,7 +90,7 @@ TEST_P(BinaryContextTester, FlushPendingRelocCALL26) {
8990
BS.addRelocation(12, RelSymbol2, ELF::R_AARCH64_CALL26, 0, 0, true);
9091

9192
std::error_code EC;
92-
SmallVector<char> Vect(sizeof(Data));
93+
SmallVector<char> Vect(DataSize);
9394
raw_svector_ostream OS(Vect);
9495

9596
BS.flushPendingRelocations(OS, [&](const MCSymbol *S) {

clang/docs/LanguageExtensions.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,7 @@ to ``float``; see below for more information on this emulation.
833833
* 32-bit ARM (natively on some architecture versions)
834834
* 64-bit ARM (AArch64) (natively on ARMv8.2a and above)
835835
* AMDGPU (natively)
836+
* NVPTX (natively)
836837
* SPIR (natively)
837838
* X86 (if SSE2 is available; natively if AVX512-FP16 is also available)
838839
* RISC-V (natively if Zfh or Zhinx is available)

clang/docs/ReleaseNotes.rst

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,6 @@ Clang Frontend Potentially Breaking Changes
6262
of ``-Wno-gnu-binary-literal`` will no longer silence this pedantic warning,
6363
which may break existing uses with ``-Werror``.
6464

65-
Target OS macros extension
66-
^^^^^^^^^^^^^^^^^^^^^^^^^^
67-
A new Clang extension (see :ref:`here <target_os_detail>`) is enabled for
68-
Darwin (Apple platform) targets. Clang now defines ``TARGET_OS_*`` macros for
69-
these targets, which could break existing code bases with improper checks for
70-
the ``TARGET_OS_`` macros. For example, existing checks might fail to include
71-
the ``TargetConditionals.h`` header from Apple SDKs and therefore leaving the
72-
macros undefined and guarded code unexercised.
73-
74-
Affected code should be checked to see if it's still intended for the specific
75-
target and fixed accordingly.
76-
77-
The extension can be turned off by the option ``-fno-define-target-os-macros``
78-
as a workaround.
79-
8065
What's New in Clang |release|?
8166
==============================
8267
Some of the major new features and improvements to Clang are listed
@@ -98,9 +83,8 @@ C++20 Feature Support
9883

9984
- Implemented the `__is_layout_compatible` intrinsic to support
10085
`P0466R5: Layout-compatibility and Pointer-interconvertibility Traits <https://wg21.link/P0466R5>`_.
101-
Note: `CWG1719: Layout compatibility and cv-qualification revisited <https://cplusplus.github.io/CWG/issues/1719.html>`_
102-
and `CWG2759: [[no_unique_address] and common initial sequence <https://cplusplus.github.io/CWG/issues/2759.html>`_
103-
are not yet implemented.
86+
Note: `CWG2759: [[no_unique_address] and common initial sequence <https://cplusplus.github.io/CWG/issues/2759.html>`_
87+
is not yet implemented.
10488

10589
C++23 Feature Support
10690
^^^^^^^^^^^^^^^^^^^^^
@@ -120,6 +104,10 @@ Resolutions to C++ Defect Reports
120104
in the template parameters, but is deduced from a previous argument.
121105
(`#78449: <https://github.com/llvm/llvm-project/issues/78449>`_).
122106

107+
- Type qualifications are now ignored when evaluating layout compatibility
108+
of two types.
109+
(`CWG1719: Layout compatibility and cv-qualification revisited <https://cplusplus.github.io/CWG/issues/1719.html>`_).
110+
123111
C Language Changes
124112
------------------
125113

@@ -158,17 +146,6 @@ Non-comprehensive list of changes in this release
158146
New Compiler Flags
159147
------------------
160148

161-
.. _target_os_detail:
162-
163-
Target OS macros extension
164-
^^^^^^^^^^^^^^^^^^^^^^^^^^
165-
A pair of new flags ``-fdefine-target-os-macros`` and
166-
``-fno-define-target-os-macros`` has been added to Clang to enable/disable the
167-
extension to provide built-in definitions of a list of ``TARGET_OS_*`` macros
168-
based on the target triple.
169-
170-
The extension is enabled by default for Darwin (Apple platform) targets.
171-
172149
Deprecated Compiler Flags
173150
-------------------------
174151

@@ -201,6 +178,18 @@ Improvements to Clang's diagnostics
201178
- Added diagnostics for C11 keywords being incompatible with language standards
202179
before C11, under a new warning group: ``-Wpre-c11-compat``.
203180

181+
- Now diagnoses an enumeration constant whose value is larger than can be
182+
represented by ``unsigned long long``, which can happen with a large constant
183+
using the ``wb`` or ``uwb`` suffix. The maximal underlying type is currently
184+
``unsigned long long``, but this behavior may change in the future when Clang
185+
implements
186+
`WG14 N3029 <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3029.htm>`_.
187+
Fixes `#69352 <https://github.com/llvm/llvm-project/issues/69352>`_.
188+
189+
- Clang now diagnoses extraneous template parameter lists as a language extension.
190+
191+
- Clang now diagnoses declarative nested name specifiers that name alias templates.
192+
204193
Improvements to Clang's time-trace
205194
----------------------------------
206195

@@ -267,6 +256,8 @@ Bug Fixes to C++ Support
267256
Fixes (`#68490 <https://github.com/llvm/llvm-project/issues/68490>`_)
268257
- Fix a crash when trying to call a varargs function that also has an explicit object parameter.
269258
Fixes (`#80971 ICE when explicit object parameter be a function parameter pack`)
259+
- Reject explicit object parameters on `new` and `delete` operators.
260+
Fixes (`#82249 <https://github.com/llvm/llvm-project/issues/82249>` _)
270261
- Fixed a bug where abbreviated function templates would append their invented template parameters to
271262
an empty template parameter lists.
272263
- Clang now classifies aggregate initialization in C++17 and newer as constant
@@ -280,6 +271,10 @@ Bug Fixes to C++ Support
280271
was only accepted at namespace scope but not at local function scope.
281272
- Clang no longer tries to call consteval constructors at runtime when they appear in a member initializer.
282273
(`#782154 <https://github.com/llvm/llvm-project/issues/82154>`_`)
274+
- Fix crash when using an immediate-escalated function at global scope.
275+
(`#82258 <https://github.com/llvm/llvm-project/issues/82258>`_)
276+
- Correctly immediate-escalate lambda conversion functions.
277+
(`#82258 <https://github.com/llvm/llvm-project/issues/82258>`_)
283278

284279
Bug Fixes to AST Handling
285280
^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -387,6 +382,14 @@ Moved checkers
387382
Sanitizers
388383
----------
389384

385+
- ``-fsanitize=signed-integer-overflow`` now instruments signed arithmetic even
386+
when ``-fwrapv`` is enabled. Previously, only division checks were enabled.
387+
388+
Users with ``-fwrapv`` as well as a sanitizer group like
389+
``-fsanitize=undefined`` or ``-fsanitize=integer`` enabled may want to
390+
manually disable potentially noisy signed integer overflow checks with
391+
``-fno-sanitize=signed-integer-overflow``
392+
390393
Python Binding Changes
391394
----------------------
392395

0 commit comments

Comments
 (0)