Skip to content

Commit f73c609

Browse files
Merge branch 'llvm:main' into gh-101657
2 parents 2461511 + c0d1403 commit f73c609

File tree

466 files changed

+21438
-11685
lines changed

Some content is hidden

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

466 files changed

+21438
-11685
lines changed

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ jobs:
124124
**/crash_diagnostics/*
125125
stage3:
126126
if: github.repository_owner == 'llvm'
127-
needs: [ stage1, stage2 ]
127+
needs: [ stage2 ]
128128
continue-on-error: false
129129
strategy:
130130
fail-fast: false
@@ -188,7 +188,7 @@ jobs:
188188
**/crash_diagnostics/*
189189
190190
macos:
191-
needs: [ stage1 ]
191+
needs: [ stage3 ]
192192
strategy:
193193
fail-fast: false
194194
matrix:
@@ -232,7 +232,7 @@ jobs:
232232
233233
windows:
234234
runs-on: windows-2022
235-
needs: [ stage1 ]
235+
needs: [ stage2 ]
236236
strategy:
237237
fail-fast: false
238238
matrix:

bolt/lib/Passes/Inliner.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ ForceInlineFunctions("force-inline",
4949
cl::Hidden,
5050
cl::cat(BoltOptCategory));
5151

52+
static cl::list<std::string> SkipInlineFunctions(
53+
"skip-inline", cl::CommaSeparated,
54+
cl::desc("list of functions to never consider for inlining"),
55+
cl::value_desc("func1,func2,func3,..."), cl::Hidden,
56+
cl::cat(BoltOptCategory));
57+
5258
static cl::opt<bool> InlineAll("inline-all", cl::desc("inline all functions"),
5359
cl::cat(BoltOptCategory));
5460

@@ -105,6 +111,12 @@ bool mustConsider(const llvm::bolt::BinaryFunction &Function) {
105111
return false;
106112
}
107113

114+
bool mustSkip(const llvm::bolt::BinaryFunction &Function) {
115+
return llvm::any_of(opts::SkipInlineFunctions, [&](const std::string &Name) {
116+
return Function.hasName(Name);
117+
});
118+
}
119+
108120
void syncOptions() {
109121
if (opts::InlineIgnoreCFI)
110122
opts::InlineIgnoreLeafCFI = true;
@@ -223,7 +235,7 @@ InliningInfo getInliningInfo(const BinaryFunction &BF) {
223235
void Inliner::findInliningCandidates(BinaryContext &BC) {
224236
for (const auto &BFI : BC.getBinaryFunctions()) {
225237
const BinaryFunction &Function = BFI.second;
226-
if (!shouldOptimize(Function))
238+
if (!shouldOptimize(Function) || opts::mustSkip(Function))
227239
continue;
228240
const InliningInfo InlInfo = getInliningInfo(Function);
229241
if (InlInfo.Type != INL_NONE)

bolt/test/X86/skip-inline.s

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
## Check skip-inline flag behavior
2+
3+
# RUN: llvm-mc --filetype=obj --triple=x86_64-unknown-unknown %s -o %t.o
4+
# RUN: ld.lld %t.o -o %t.exe -q
5+
# RUN: llvm-bolt %t.exe --inline-small-functions --print-finalized --print-only=main \
6+
# RUN: -o %t.null | FileCheck %s --check-prefix=CHECK-INLINE
7+
# RUN: llvm-bolt %t.exe --inline-small-functions --skip-inline=foo --print-finalized \
8+
# RUN: --print-only=main -o %t.null | FileCheck %s --check-prefix=CHECK-NO-INLINE
9+
# CHECK-INLINE: Binary Function "main"
10+
# CHECK-INLINE: ud2
11+
# CHECK-NO-INLINE: Binary Function "main"
12+
# CHECK-NO-INLINE: callq foo
13+
14+
.globl _start
15+
_start:
16+
call main
17+
18+
.globl main
19+
main:
20+
call foo
21+
ret
22+
23+
.globl foo
24+
foo:
25+
ud2
26+
ret

clang-tools-extra/test/clang-tidy/checkers/bugprone/chained-comparison.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %check_clang_tidy %s bugprone-chained-comparison %t
1+
// RUN: %check_clang_tidy --extra-arg=-Wno-error=parentheses %s bugprone-chained-comparison %t
22

33
void badly_chained_1(int x, int y, int z)
44
{

clang-tools-extra/test/clang-tidy/checkers/bugprone/chained-comparison.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %check_clang_tidy -std=c++98-or-later %s bugprone-chained-comparison %t
1+
// RUN: %check_clang_tidy -std=c++98-or-later --extra-arg=-Wno-error=parentheses %s bugprone-chained-comparison %t
22

33
void badly_chained_1(int x, int y, int z)
44
{

clang/docs/ClangFormatStyleOptions.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4782,7 +4782,13 @@ the configuration (without a prefix: ``Auto``).
47824782
.. _Language:
47834783

47844784
**Language** (``LanguageKind``) :versionbadge:`clang-format 3.5` :ref:`<Language>`
4785-
Language, this format style is targeted at.
4785+
The language that this format style targets.
4786+
4787+
.. note::
4788+
4789+
You can also specify the language (``Cpp`` or ``ObjC``) for ``.h`` files
4790+
by adding a ``// clang-format Language:`` line before the first
4791+
non-comment (and non-empty) line, e.g. ``// clang-format Language: Cpp``.
47864792

47874793
Possible values:
47884794

clang/docs/ReleaseNotes.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ Improvements to Clang's diagnostics
147147
- The ``-Wunsafe-buffer-usage`` warning has been updated to warn
148148
about unsafe libc function calls. Those new warnings are emitted
149149
under the subgroup ``-Wunsafe-buffer-usage-in-libc-call``.
150+
- Diagnostics on chained comparisons (``a < b < c``) are now an error by default. This can be disabled with
151+
``-Wno-error=parentheses``.
150152

151153
Improvements to Clang's time-trace
152154
----------------------------------
@@ -269,6 +271,9 @@ clang-format
269271
- Adds ``BreakBeforeTemplateCloser`` option.
270272
- Adds ``BinPackLongBracedList`` option to override bin packing options in
271273
long (20 item or more) braced list initializer lists.
274+
- Allow specifying the language (C++ or Objective-C) for a ``.h`` file by adding
275+
a special comment (e.g. ``// clang-format Language: ObjC``) near the top of
276+
the file.
272277

273278
libclang
274279
--------
@@ -282,10 +287,6 @@ Code Completion
282287
Static Analyzer
283288
---------------
284289

285-
- Clang currently support extending lifetime of object bound to
286-
reference members of aggregates in CFG and ExprEngine, that are
287-
created from default member initializer.
288-
289290
New features
290291
^^^^^^^^^^^^
291292

clang/include/clang/Basic/Builtins.td

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,12 @@ def TruncF16F128 : Builtin, F16F128MathTemplate {
521521
let Prototype = "T(T)";
522522
}
523523

524+
def Sincospi : Builtin, FPMathTemplate {
525+
let Spellings = ["__builtin_sincospi"];
526+
let Attributes = [FunctionWithBuiltinPrefix, NoThrow];
527+
let Prototype = "void(T, T*, T*)";
528+
}
529+
524530
// Access to floating point environment.
525531
def BuiltinFltRounds : Builtin {
526532
let Spellings = ["__builtin_flt_rounds"];

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,11 @@ def err_cpu_unsupported_isa
279279
def err_arch_unsupported_isa
280280
: Error<"architecture '%0' does not support '%1' execution mode">;
281281

282+
def err_zos_target_release_discontinued
283+
: Error<"z/OS target level \"%0\" is discontinued">;
284+
def err_zos_target_unrecognized_release
285+
: Error<"z/OS target level \"%0\" is invalid">;
286+
282287
def err_drv_I_dash_not_supported : Error<
283288
"'%0' not supported, please use -iquote instead">;
284289
def err_drv_unknown_argument : Error<"unknown argument: '%0'">;

clang/include/clang/Basic/DiagnosticParseKinds.td

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1657,10 +1657,6 @@ def err_omp_expected_colon : Error<"missing ':' in %0">;
16571657
def err_omp_missing_comma : Error< "missing ',' after %0">;
16581658
def err_omp_expected_context_selector
16591659
: Error<"expected valid context selector in %0">;
1660-
def err_omp_unknown_clause
1661-
: Error<"unknown clause '%0' in %1">;
1662-
def warn_omp_default_deprecated : Warning<"'default' clause for"
1663-
" 'metadirective' is deprecated; use 'otherwise' instead">, InGroup<Deprecated>;
16641660
def err_omp_requires_out_inout_depend_type : Error<
16651661
"reserved locator 'omp_all_memory' requires 'out' or 'inout' "
16661662
"dependency types">;

0 commit comments

Comments
 (0)