Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit cf37bdb

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged main:a384cd5012b857f2464fff21c39d032632af1515 into amd-gfx:5aaffd43ea2e
Local branch amd-gfx 5aaffd4 Merged main:a1f1371fdc7d9af9edf32339dcfebada96d937a5 into amd-gfx:45668192a2fc Remote branch main a384cd5 [X86][BF16] Add subvec_zero_lowering patterns (llvm#76507)
2 parents 5aaffd4 + a384cd5 commit cf37bdb

File tree

100 files changed

+1518
-554
lines changed

Some content is hidden

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

100 files changed

+1518
-554
lines changed

clang/docs/ClangFormat.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,27 @@ An easy way to create the ``.clang-format`` file is:
131131
132132
Available style options are described in :doc:`ClangFormatStyleOptions`.
133133

134+
You can create ``.clang-format-ignore`` files to make ``clang-format`` ignore
135+
certain files. A ``.clang-format-ignore`` file consists of patterns of file path
136+
names. It has the following format:
137+
138+
* A blank line is skipped.
139+
* Leading and trailing spaces of a line are trimmed.
140+
* A line starting with a hash (``#``) is a comment.
141+
* A non-comment line is a single pattern.
142+
* The slash (``/``) is used as the directory separator.
143+
* A pattern is relative to the directory of the ``.clang-format-ignore`` file
144+
(or the root directory if the pattern starts with a slash).
145+
* Patterns follow the rules specified in `POSIX 2.13.1, 2.13.2, and Rule 1 of
146+
2.13.3 <https://pubs.opengroup.org/onlinepubs/9699919799/utilities/
147+
V3_chap02.html#tag_18_13>`_.
148+
* A pattern is negated if it starts with a bang (``!``).
149+
150+
To match all files in a directory, use e.g. ``foo/bar/*``. To match all files in
151+
the directory of the ``.clang-format-ignore`` file, use ``*``.
152+
Multiple ``.clang-format-ignore`` files are supported similar to the
153+
``.clang-format`` files, with a lower directory level file voiding the higher
154+
level ones.
134155

135156
Vim Integration
136157
===============

clang/docs/LibASTMatchersTutorial.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Okay. Now we'll build Clang!
5050
5151
cd ~/clang-llvm
5252
mkdir build && cd build
53-
cmake -G Ninja ../llvm -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" -DLLVM_BUILD_TESTS=ON # Enable tests; default is off.
53+
cmake -G Ninja ../llvm -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" -DCMAKE_BUILD_TYPE=Release -DLLVM_BUILD_TESTS=ON
5454
ninja
5555
ninja check # Test LLVM only.
5656
ninja clang-test # Test Clang only.

clang/docs/ReleaseNotes.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1041,6 +1041,7 @@ clang-format
10411041
- Add ``BreakAdjacentStringLiterals`` option.
10421042
- Add ``ObjCPropertyAttributeOrder`` which can be used to sort ObjC property
10431043
attributes (like ``nonatomic, strong, nullable``).
1044+
- Add ``.clang-format-ignore`` files.
10441045

10451046
libclang
10461047
--------
@@ -1126,9 +1127,11 @@ Improvements
11261127
^^^^^^^^^^^^
11271128

11281129
- Improved the ``unix.StdCLibraryFunctions`` checker by modeling more
1129-
functions like ``send``, ``recv``, ``readlink`` and ``errno`` behavior.
1130+
functions like ``send``, ``recv``, ``readlink``, ``fflush`` and
1131+
``errno`` behavior.
11301132
(`52ac71f92d38 <https://github.com/llvm/llvm-project/commit/52ac71f92d38f75df5cb88e9c090ac5fd5a71548>`_,
11311133
`#71373 <https://github.com/llvm/llvm-project/pull/71373>`_,
1134+
`#76557 <https://github.com/llvm/llvm-project/pull/76557>`_,
11321135
`#71392 <https://github.com/llvm/llvm-project/pull/71392>`_)
11331136

11341137
- Fixed a false negative for when accessing a nonnull property (ObjC).

clang/include/clang/Basic/riscv_sifive_vector.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ multiclass RVVVFWMACCBuiltinSet<list<list<string>> suffixes_prototypes> {
109109
Name = NAME,
110110
HasMasked = false,
111111
Log2LMUL = [-2, -1, 0, 1, 2] in
112-
defm NAME : RVVOutOp1Op2BuiltinSet<NAME, "b", suffixes_prototypes>;
112+
defm NAME : RVVOutOp1Op2BuiltinSet<NAME, "y", suffixes_prototypes>;
113113
}
114114

115115
multiclass RVVVQMACCDODBuiltinSet<list<list<string>> suffixes_prototypes> {

clang/include/clang/Basic/riscv_vector_common.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
// x: float16_t (half)
4242
// f: float32_t (float)
4343
// d: float64_t (double)
44-
// b: bfloat16_t (bfloat16)
44+
// y: bfloat16_t (bfloat16)
4545
//
4646
// This way, given an LMUL, a record with a TypeRange "sil" will cause the
4747
// definition of 3 builtins. Each type "t" in the TypeRange (in this example

clang/lib/Format/ContinuationIndenter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ bool ContinuationIndenter::mustBreak(const LineState &State) {
398398
}
399399
if ((startsNextParameter(Current, Style) || Previous.is(tok::semi) ||
400400
(Previous.is(TT_TemplateCloser) && Current.is(TT_StartOfName) &&
401-
Style.isCpp() &&
401+
State.Line->First->isNot(TT_AttributeSquare) && Style.isCpp() &&
402402
// FIXME: This is a temporary workaround for the case where clang-format
403403
// sets BreakBeforeParameter to avoid bin packing and this creates a
404404
// completely unnecessary line break after a template type that isn't

clang/lib/Format/MatchFilePath.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ using namespace llvm;
1919
namespace clang {
2020
namespace format {
2121

22-
// Check whether `FilePath` matches `Pattern` based on POSIX (1003.1-2008)
23-
// 2.13.1, 2.13.2, and Rule 1 of 2.13.3.
22+
// Check whether `FilePath` matches `Pattern` based on POSIX 2.13.1, 2.13.2, and
23+
// Rule 1 of 2.13.3.
2424
bool matchFilePath(StringRef Pattern, StringRef FilePath) {
2525
assert(!Pattern.empty());
2626
assert(!FilePath.empty());

clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2244,6 +2244,14 @@ void StdLibraryFunctionsChecker::initFunctionSummaries(
22442244
.ArgConstraint(NotNull(ArgNo(0)))
22452245
.ArgConstraint(NotNull(ArgNo(1))));
22462246

2247+
// int fflush(FILE *stream);
2248+
addToFunctionSummaryMap(
2249+
"fflush", Signature(ArgTypes{FilePtrTy}, RetType{IntTy}),
2250+
Summary(NoEvalCall)
2251+
.Case(ReturnsZero, ErrnoMustNotBeChecked, GenericSuccessMsg)
2252+
.Case({ReturnValueCondition(WithinRange, SingleValue(EOFv))},
2253+
ErrnoNEZeroIrrelevant, GenericFailureMsg));
2254+
22472255
// long ftell(FILE *stream);
22482256
// From 'The Open Group Base Specifications Issue 7, 2018 edition':
22492257
// "The ftell() function shall not change the setting of errno if

clang/lib/Support/RISCVVIntrinsicUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ void RVVType::initBuiltinStr() {
203203
}
204204
break;
205205
case ScalarTypeKind::BFloat:
206-
BuiltinStr += "b";
206+
BuiltinStr += "y";
207207
break;
208208
default:
209209
llvm_unreachable("ScalarType is invalid!");

clang/test/Analysis/stream-errno.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,3 +222,29 @@ void check_fileno(void) {
222222
}
223223
if (errno) {} // expected-warning{{An undefined value may be read from 'errno'}}
224224
}
225+
226+
void check_fflush_opened_file(void) {
227+
FILE *F = tmpfile();
228+
if (!F)
229+
return;
230+
int N = fflush(F);
231+
if (N == EOF) {
232+
clang_analyzer_eval(errno != 0); // expected-warning{{TRUE}}
233+
if (errno) {} // no-warning
234+
} else {
235+
clang_analyzer_eval(N == 0); // expected-warning{{TRUE}}
236+
if (errno) {} // expected-warning{{An undefined value may be read from 'errno'}}
237+
}
238+
fclose(F);
239+
}
240+
241+
void check_fflush_all(void) {
242+
int N = fflush(NULL);
243+
if (N == 0) {
244+
if (errno) {} // expected-warning{{An undefined value may be read from 'errno'}}
245+
} else {
246+
clang_analyzer_eval(N == EOF); // expected-warning{{TRUE}}
247+
clang_analyzer_eval(errno != 0); // expected-warning{{TRUE}}
248+
if (errno) {} // no-warning
249+
}
250+
}

0 commit comments

Comments
 (0)