Skip to content

Commit af9639f

Browse files
committed
Merge branch 'main' of https://github.com/llvm/llvm-project into fixdincorrectdelofctoronsomeunionspart2
2 parents 5fcaead + 9eff001 commit af9639f

File tree

729 files changed

+43956
-25502
lines changed

Some content is hidden

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

729 files changed

+43956
-25502
lines changed

.ci/generate-buildkite-pipeline-premerge

+1-4
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

+10-1
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

+3-1
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

+13-7
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/lib/Core/BinarySection.cpp

+1-12
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/Rewrite/RewriteInstance.cpp

+3-6
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

+5-4
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

+1
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

+20-3
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,8 @@ C++20 Feature Support
9898

9999
- Implemented the `__is_layout_compatible` intrinsic to support
100100
`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.
101+
Note: `CWG2759: [[no_unique_address] and common initial sequence <https://cplusplus.github.io/CWG/issues/2759.html>`_
102+
is not yet implemented.
104103

105104
C++23 Feature Support
106105
^^^^^^^^^^^^^^^^^^^^^
@@ -120,6 +119,10 @@ Resolutions to C++ Defect Reports
120119
in the template parameters, but is deduced from a previous argument.
121120
(`#78449: <https://github.com/llvm/llvm-project/issues/78449>`_).
122121

122+
- Type qualifications are now ignored when evaluating layout compatibility
123+
of two types.
124+
(`CWG1719: Layout compatibility and cv-qualification revisited <https://cplusplus.github.io/CWG/issues/1719.html>`_).
125+
123126
C Language Changes
124127
------------------
125128

@@ -279,6 +282,8 @@ Bug Fixes to C++ Support
279282
Fixes (`#68490 <https://github.com/llvm/llvm-project/issues/68490>`_)
280283
- Fix a crash when trying to call a varargs function that also has an explicit object parameter.
281284
Fixes (`#80971 ICE when explicit object parameter be a function parameter pack`)
285+
- Reject explicit object parameters on `new` and `delete` operators.
286+
Fixes (`#82249 <https://github.com/llvm/llvm-project/issues/82249>` _)
282287
- Fixed a bug where abbreviated function templates would append their invented template parameters to
283288
an empty template parameter lists.
284289
- Clang now classifies aggregate initialization in C++17 and newer as constant
@@ -292,6 +297,10 @@ Bug Fixes to C++ Support
292297
was only accepted at namespace scope but not at local function scope.
293298
- Clang no longer tries to call consteval constructors at runtime when they appear in a member initializer.
294299
(`#782154 <https://github.com/llvm/llvm-project/issues/82154>`_`)
300+
- Fix crash when using an immediate-escalated function at global scope.
301+
(`#82258 <https://github.com/llvm/llvm-project/issues/82258>`_)
302+
- Correctly immediate-escalate lambda conversion functions.
303+
(`#82258 <https://github.com/llvm/llvm-project/issues/82258>`_)
295304
- Fix for clang incorrectly rejecting the default construction of a union with
296305
nontrivial member when another member has an initializer.
297306
(`#81774 <https://github.com/llvm/llvm-project/issues/81774>`_)
@@ -402,6 +411,14 @@ Moved checkers
402411
Sanitizers
403412
----------
404413

414+
- ``-fsanitize=signed-integer-overflow`` now instruments signed arithmetic even
415+
when ``-fwrapv`` is enabled. Previously, only division checks were enabled.
416+
417+
Users with ``-fwrapv`` as well as a sanitizer group like
418+
``-fsanitize=undefined`` or ``-fsanitize=integer`` enabled may want to
419+
manually disable potentially noisy signed integer overflow checks with
420+
``-fno-sanitize=signed-integer-overflow``
421+
405422
Python Binding Changes
406423
----------------------
407424

clang/docs/UndefinedBehaviorSanitizer.rst

+5-4
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,11 @@ Available checks are:
190190
- ``-fsanitize=signed-integer-overflow``: Signed integer overflow, where the
191191
result of a signed integer computation cannot be represented in its type.
192192
This includes all the checks covered by ``-ftrapv``, as well as checks for
193-
signed division overflow (``INT_MIN/-1``), but not checks for
194-
lossy implicit conversions performed before the computation
195-
(see ``-fsanitize=implicit-conversion``). Both of these two issues are
196-
handled by ``-fsanitize=implicit-conversion`` group of checks.
193+
signed division overflow (``INT_MIN/-1``). Note that checks are still
194+
added even when ``-fwrapv`` is enabled. This sanitizer does not check for
195+
lossy implicit conversions performed before the computation (see
196+
``-fsanitize=implicit-conversion``). Both of these two issues are handled
197+
by ``-fsanitize=implicit-conversion`` group of checks.
197198
- ``-fsanitize=unreachable``: If control flow reaches an unreachable
198199
program point.
199200
- ``-fsanitize=unsigned-integer-overflow``: Unsigned integer overflow, where

clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h

+6-3
Original file line numberDiff line numberDiff line change
@@ -753,9 +753,12 @@ RecordStorageLocation *getImplicitObjectLocation(const CXXMemberCallExpr &MCE,
753753
RecordStorageLocation *getBaseObjectLocation(const MemberExpr &ME,
754754
const Environment &Env);
755755

756-
/// Returns the fields of `RD` that are initialized by an `InitListExpr`, in the
757-
/// order in which they appear in `InitListExpr::inits()`.
758-
std::vector<FieldDecl *> getFieldsForInitListExpr(const RecordDecl *RD);
756+
/// Returns the fields of a `RecordDecl` that are initialized by an
757+
/// `InitListExpr`, in the order in which they appear in
758+
/// `InitListExpr::inits()`.
759+
/// `Init->getType()` must be a record type.
760+
std::vector<const FieldDecl *>
761+
getFieldsForInitListExpr(const InitListExpr *InitList);
759762

760763
/// Associates a new `RecordValue` with `Loc` and returns the new value.
761764
RecordValue &refreshRecordValue(RecordStorageLocation &Loc, Environment &Env);

clang/include/clang/Basic/DiagnosticDriverKinds.td

-3
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,4 @@ def warn_android_unversioned_fallback : Warning<
804804

805805
def err_drv_triple_version_invalid : Error<
806806
"version '%0' in target triple '%1' is invalid">;
807-
808-
def err_drv_installapi_unsupported : Error<
809-
"InstallAPI is not supported for '%0'">;
810807
}

clang/include/clang/Driver/Action.h

-12
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ class Action {
5959
PreprocessJobClass,
6060
PrecompileJobClass,
6161
ExtractAPIJobClass,
62-
InstallAPIJobClass,
6362
AnalyzeJobClass,
6463
MigrateJobClass,
6564
CompileJobClass,
@@ -449,17 +448,6 @@ class ExtractAPIJobAction : public JobAction {
449448
void addHeaderInput(Action *Input) { getInputs().push_back(Input); }
450449
};
451450

452-
class InstallAPIJobAction : public JobAction {
453-
void anchor() override;
454-
455-
public:
456-
InstallAPIJobAction(Action *Input, types::ID OutputType);
457-
458-
static bool classof(const Action *A) {
459-
return A->getKind() == InstallAPIJobClass;
460-
}
461-
};
462-
463451
class AnalyzeJobAction : public JobAction {
464452
void anchor() override;
465453

clang/include/clang/Driver/Driver.h

+10
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,11 @@ class Driver {
251251
/// from non-system headers are emitted.
252252
HeaderIncludeFilteringKind CCPrintHeadersFiltering = HIFIL_None;
253253

254+
/// Name of the library that provides implementations of
255+
/// IEEE-754 128-bit float math functions used by Fortran F128
256+
/// runtime library. It should be linked as needed by the linker job.
257+
std::string FlangF128MathLibrary;
258+
254259
/// Set CC_LOG_DIAGNOSTICS mode, which causes the frontend to log diagnostics
255260
/// to CCLogDiagnosticsFilename or to stderr, in a stable machine readable
256261
/// format.
@@ -440,6 +445,11 @@ class Driver {
440445
bool offloadHostOnly() const { return Offload == OffloadHost; }
441446
bool offloadDeviceOnly() const { return Offload == OffloadDevice; }
442447

448+
void setFlangF128MathLibrary(std::string name) {
449+
FlangF128MathLibrary = std::move(name);
450+
}
451+
StringRef getFlangF128MathLibrary() const { return FlangF128MathLibrary; }
452+
443453
/// Compute the desired OpenMP runtime from the flags provided.
444454
OpenMPRuntimeKind getOpenMPRuntime(const llvm::opt::ArgList &Args) const;
445455

clang/include/clang/Driver/Options.td

+2-10
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,6 @@ class AnalyzerOpts<string base>
336336
: KeyPathAndMacro<"AnalyzerOpts->", base, "ANALYZER_"> {}
337337
class MigratorOpts<string base>
338338
: KeyPathAndMacro<"MigratorOpts.", base, "MIGRATOR_"> {}
339-
class InstallAPIOpts<string base>
340-
: KeyPathAndMacro<"InstallAPIOpts.", base, "INSTALLAPI_"> {}
341339

342340
// A boolean option which is opt-in in CC1. The positive option exists in CC1 and
343341
// Args.hasArg(OPT_ffoo) can be used to check that the flag is enabled.
@@ -1143,8 +1141,7 @@ def config_user_dir_EQ : Joined<["--"], "config-user-dir=">,
11431141
def coverage : Flag<["-", "--"], "coverage">, Group<Link_Group>,
11441142
Visibility<[ClangOption, CLOption]>;
11451143
def cpp_precomp : Flag<["-"], "cpp-precomp">, Group<clang_ignored_f_Group>;
1146-
def current__version : JoinedOrSeparate<["-"], "current_version">,
1147-
Visibility<[ClangOption, CC1Option]>;
1144+
def current__version : JoinedOrSeparate<["-"], "current_version">;
11481145
def cxx_isystem : JoinedOrSeparate<["-"], "cxx-isystem">, Group<clang_i_Group>,
11491146
HelpText<"Add directory to the C++ SYSTEM include search path">,
11501147
Visibility<[ClangOption, CC1Option]>,
@@ -1559,9 +1556,6 @@ def static_libsan : Flag<["-"], "static-libsan">,
15591556
HelpText<"Statically link the sanitizer runtime (Not supported for ASan, TSan or UBSan on darwin)">;
15601557
def : Flag<["-"], "shared-libasan">, Alias<shared_libsan>;
15611558
def fasm : Flag<["-"], "fasm">, Group<f_Group>;
1562-
def installapi : Flag<["-"], "installapi">,
1563-
Visibility<[ClangOption, CC1Option]>, Group<Action_Group>,
1564-
HelpText<"Create a text-based stub file by scanning header files">;
15651559

15661560
defm assume_unique_vtables : BoolFOption<"assume-unique-vtables",
15671561
CodeGenOpts<"AssumeUniqueVTables">, DefaultTrue,
@@ -4320,9 +4314,7 @@ def verify_pch : Flag<["-"], "verify-pch">, Group<Action_Group>,
43204314
Visibility<[ClangOption, CC1Option]>,
43214315
HelpText<"Load and verify that a pre-compiled header file is not stale">;
43224316
def init : Separate<["-"], "init">;
4323-
def install__name : Separate<["-"], "install_name">,
4324-
Visibility<[ClangOption, CC1Option]>,
4325-
MarshallingInfoString<InstallAPIOpts<"InstallName">>;
4317+
def install__name : Separate<["-"], "install_name">;
43264318
def iprefix : JoinedOrSeparate<["-"], "iprefix">, Group<clang_i_Group>,
43274319
Visibility<[ClangOption, CC1Option]>,
43284320
HelpText<"Set the -iwithprefix/-iwithprefixbefore prefix">, MetaVarName<"<dir>">;

clang/include/clang/Driver/Types.def

-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ TYPE("lto-bc", LTO_BC, INVALID, "o", phases
9494
TYPE("ast", AST, INVALID, "ast", phases::Compile, phases::Backend, phases::Assemble, phases::Link)
9595
TYPE("ifs", IFS, INVALID, "ifs", phases::IfsMerge)
9696
TYPE("ifs-cpp", IFS_CPP, INVALID, "ifs", phases::Compile, phases::IfsMerge)
97-
TYPE("tbd", TextAPI, INVALID, "tbd", phases::Precompile)
9897
TYPE("pcm", ModuleFile, INVALID, "pcm", phases::Compile, phases::Backend, phases::Assemble, phases::Link)
9998
TYPE("header-unit", HeaderUnit, INVALID, "pcm", phases::Compile, phases::Backend, phases::Assemble, phases::Link)
10099
TYPE("plist", Plist, INVALID, "plist", phases::Compile, phases::Backend, phases::Assemble, phases::Link)

clang/include/clang/Frontend/CompilerInstance.h

-7
Original file line numberDiff line numberDiff line change
@@ -294,13 +294,6 @@ class CompilerInstance : public ModuleLoader {
294294
return Invocation->getFrontendOpts();
295295
}
296296

297-
InstallAPIOptions &getInstallAPIOpts() {
298-
return Invocation->getInstallAPIOpts();
299-
}
300-
const InstallAPIOptions &getInstallAPIOpts() const {
301-
return Invocation->getInstallAPIOpts();
302-
}
303-
304297
HeaderSearchOptions &getHeaderSearchOpts() {
305298
return Invocation->getHeaderSearchOpts();
306299
}

0 commit comments

Comments
 (0)