Skip to content

Commit 15f16bc

Browse files
committed
2 parents 9db542f + db98ac4 commit 15f16bc

File tree

380 files changed

+9497
-3621
lines changed

Some content is hidden

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

380 files changed

+9497
-3621
lines changed

clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,19 @@ in .clang-tidy file, if any.
162162
cl::init(false), cl::cat(ClangTidyCategory));
163163

164164
static cl::opt<std::string> LineFilter("line-filter", desc(R"(
165-
List of files with line ranges to filter the
166-
warnings. Can be used together with
167-
-header-filter. The format of the list is a
168-
JSON array of objects:
165+
List of files and line ranges to output diagnostics from.
166+
The range is inclusive on both ends. Can be used together
167+
with -header-filter. The format of the list is a JSON
168+
array of objects. For example:
169+
169170
[
170171
{"name":"file1.cpp","lines":[[1,3],[5,7]]},
171172
{"name":"file2.h"}
172173
]
174+
175+
This will output diagnostics from 'file1.cpp' only for
176+
the line ranges [1,3] and [5,7], as well as all from the
177+
entire 'file2.h'.
173178
)"),
174179
cl::init(""),
175180
cl::cat(ClangTidyCategory));

clang-tools-extra/clang-tidy/tool/run-clang-tidy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ async def main() -> None:
483483
parser.add_argument(
484484
"-line-filter",
485485
default=None,
486-
help="List of files with line ranges to filter the warnings.",
486+
help="List of files and line ranges to output diagnostics from.",
487487
)
488488
if yaml:
489489
parser.add_argument(

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ Improvements to clang-tidy
109109
`enable-check-profile` to enable per-check timing profiles and print a
110110
report based on all analyzed files.
111111

112+
- Improved documentation of the `-line-filter` command-line flag of
113+
:program:`clang-tidy` and :program:`run-clang-tidy.py`.
114+
112115
New checks
113116
^^^^^^^^^^
114117

clang-tools-extra/docs/clang-tidy/index.rst

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,14 +213,19 @@ An overview of all the command-line options:
213213
Can be used together with -line-filter.
214214
This option overrides the 'HeaderFilterRegex'
215215
option in .clang-tidy file, if any.
216-
--line-filter=<string> - List of files with line ranges to filter the
217-
warnings. Can be used together with
218-
-header-filter. The format of the list is a
219-
JSON array of objects:
216+
--line-filter=<string> - List of files and line ranges to output diagnostics from.
217+
The range is inclusive on both ends. Can be used together
218+
with -header-filter. The format of the list is a JSON
219+
array of objects. For example:
220+
220221
[
221222
{"name":"file1.cpp","lines":[[1,3],[5,7]]},
222223
{"name":"file2.h"}
223224
]
225+
226+
This will output diagnostics from 'file1.cpp' only for
227+
the line ranges [1,3] and [5,7], as well as all from the
228+
entire 'file2.h'.
224229
--list-checks - List all enabled checks and exit. Use with
225230
-checks=* to list all available checks.
226231
--load=<pluginfilename> - Load the specified plugin

clang/docs/LanguageExtensions.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,8 @@ Unless specified otherwise operation(±0) = ±0 and operation(±infinity) = ±in
760760
The integer elementwise intrinsics, including ``__builtin_elementwise_popcount``,
761761
``__builtin_elementwise_bitreverse``, ``__builtin_elementwise_add_sat``,
762762
``__builtin_elementwise_sub_sat``, ``__builtin_elementwise_max``,
763-
``__builtin_elementwise_min`` can be called in a ``constexpr`` context.
763+
``__builtin_elementwise_min``, and ``__builtin_elementwise_abs``
764+
can be called in a ``constexpr`` context.
764765

765766
No implicit promotion of integer types takes place. The mixing of integer types
766767
of different sizes and signs is forbidden in binary and ternary builtins.

clang/docs/OpenMPSupport.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ implementation.
376376
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
377377
| loop stripe transformation | :good:`done` | https://github.com/llvm/llvm-project/pull/119891 |
378378
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
379-
| work distribute construct | :none:`unclaimed` | :none:`unclaimed` | |
379+
| workdistribute construct | | :none:`in progress` | @skc7, @mjklemm |
380380
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
381381
| task_iteration | :none:`unclaimed` | :none:`unclaimed` | |
382382
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
@@ -476,6 +476,10 @@ implementation.
476476
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
477477
| Local clause on declare target | :part:`In Progress` | :none:`unclaimed` | |
478478
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
479+
| groupprivate directive | :part:`In Progress` | :part:`In Progress` | Flang: kparzysz, mjklemm |
480+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
481+
| variable-category on default clause | :part:`In Progress` | :none:`unclaimed` | |
482+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
479483
| Changes to omp_target_is_accessible | :part:`In Progress` | :part:`In Progress` | |
480484
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
481485

clang/docs/ReleaseNotes.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ Non-comprehensive list of changes in this release
115115
-------------------------------------------------
116116
- Added ``__builtin_elementwise_fshl`` and ``__builtin_elementwise_fshr``.
117117

118+
- ``__builtin_elementwise_abs`` can now be used in constant expression.
119+
118120
- Added ``__builtin_elementwise_minnumnum`` and ``__builtin_elementwise_maxnumnum``.
119121

120122
- Trapping UBSan (e.g. ``-fsanitize-trap=undefined``) now emits a string describing the reason for
@@ -166,6 +168,10 @@ Improvements to Clang's diagnostics
166168
"signedness of format specifier 'u' is incompatible with 'c' [-Wformat-signedness]"
167169
and the API-visible diagnostic id will be appropriate.
168170

171+
- Fixed false positives in ``-Waddress-of-packed-member`` diagnostics when
172+
potential misaligned members get processed before they can get discarded.
173+
(#GH144729)
174+
169175
Improvements to Clang's time-trace
170176
----------------------------------
171177

@@ -192,6 +198,9 @@ Bug Fixes to Attribute Support
192198

193199
- ``[[nodiscard]]`` is now respected on Objective-C and Objective-C++ methods.
194200
(#GH141504)
201+
- Fixes some late parsed attributes, when applied to function definitions, not being parsed
202+
in function try blocks, and some situations where parsing of the function body
203+
is skipped, such as error recovery and code completion. (#GH153551)
195204
- Using ``[[gnu::cleanup(some_func)]]`` where some_func is annotated with
196205
``[[gnu::error("some error")]]`` now correctly triggers an error. (#GH146520)
197206

@@ -206,12 +215,14 @@ Bug Fixes to C++ Support
206215
casts that are guaranteed to fail (#GH137518).
207216
- Fix bug rejecting partial specialization of variable templates with auto NTTPs (#GH118190).
208217
- Fix a crash when using ``explicit(bool)`` in pre-C++11 language modes. (#GH152729)
218+
- Fix the parsing of variadic member functions when the ellipis immediately follows a default argument.(#GH153445)
209219

210220
Bug Fixes to AST Handling
211221
^^^^^^^^^^^^^^^^^^^^^^^^^
212222
- Fix incorrect name qualifiers applied to alias CTAD. (#GH136624)
213223
- Fixed ElaboratedTypes appearing within NestedNameSpecifier, which was not a
214224
legal representation. This is fixed because ElaboratedTypes don't exist anymore. (#GH43179) (#GH68670) (#GH92757)
225+
- Fix comment lexing of special command names (#GH152943)
215226

216227
Miscellaneous Bug Fixes
217228
^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/Basic/Builtins.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1264,7 +1264,7 @@ def NondetermenisticValue : Builtin {
12641264

12651265
def ElementwiseAbs : Builtin {
12661266
let Spellings = ["__builtin_elementwise_abs"];
1267-
let Attributes = [NoThrow, Const, CustomTypeChecking];
1267+
let Attributes = [NoThrow, Const, CustomTypeChecking, Constexpr];
12681268
let Prototype = "void(...)";
12691269
}
12701270

clang/include/clang/CIR/Dialect/IR/CIROps.td

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2254,6 +2254,87 @@ def CIR_StackRestoreOp : CIR_Op<"stackrestore"> {
22542254
let assemblyFormat = "$ptr attr-dict `:` qualified(type($ptr))";
22552255
}
22562256

2257+
//===----------------------------------------------------------------------===//
2258+
// InlineAsmOp
2259+
//===----------------------------------------------------------------------===//
2260+
2261+
def CIR_AsmFlavor : CIR_I32EnumAttr<"AsmFlavor", "ATT or Intel",
2262+
[I32EnumAttrCase<"x86_att", 0>,
2263+
I32EnumAttrCase<"x86_intel", 1>]>;
2264+
2265+
def CIR_InlineAsmOp : CIR_Op<"asm", [RecursiveMemoryEffects]> {
2266+
let description = [{
2267+
The `cir.asm` operation represents C/C++ asm inline.
2268+
2269+
CIR constraints strings follow the same rules that are established for
2270+
the C level assembler constraints with several differences caused by
2271+
clang::AsmStmt processing.
2272+
2273+
Thus, numbers that appears in the constraint string may also refer to:
2274+
- the output variable index referenced by the input operands.
2275+
- the index of early-clobber operand
2276+
2277+
Operand attributes are a storage, where each element corresponds to the
2278+
operand with the same index. The first index relates to the operation
2279+
result (if any).
2280+
The operands themselves are stored as VariadicOfVariadic in the following
2281+
order: output, input and then in/out operands. When several output operands
2282+
are present, the result type may be represented as an anonymous record type.
2283+
2284+
Example:
2285+
```C++
2286+
__asm__("foo" : : : );
2287+
__asm__("bar $42 %[val]" : [val] "=r" (x), "+&r"(x));
2288+
__asm__("baz $42 %[val]" : [val] "=r" (x), "+&r"(x) : "[val]"(y));
2289+
```
2290+
2291+
```mlir
2292+
!rec_22anon2E022 = !cir.record<struct "anon.0" {!cir.int<s, 32>, !cir.int<s, 32>}>
2293+
!rec_22anon2E122 = !cir.record<struct "anon.1" {!cir.int<s, 32>, !cir.int<s, 32>}>
2294+
...
2295+
%0 = cir.alloca !s32i, !cir.ptr<!s32i>, ["x", init]
2296+
%1 = cir.alloca !s32i, !cir.ptr<!s32i>, ["y", init]
2297+
...
2298+
%2 = cir.load %0 : !cir.ptr<!s32i>, !s32i
2299+
%3 = cir.load %1 : !cir.ptr<!s32i>, !s32i
2300+
2301+
cir.asm(x86_att,
2302+
out = [],
2303+
in = [],
2304+
in_out = [],
2305+
{"foo" "~{dirflag},~{fpsr},~{flags}"}) side_effects
2306+
2307+
cir.asm(x86_att,
2308+
out = [],
2309+
in = [],
2310+
in_out = [%2 : !s32i],
2311+
{"bar $$42 $0" "=r,=&r,1,~{dirflag},~{fpsr},~{flags}"}) -> !rec_22anon2E022
2312+
2313+
cir.asm(x86_att,
2314+
out = [],
2315+
in = [%3 : !s32i],
2316+
in_out = [%2 : !s32i],
2317+
{"baz $$42 $0" "=r,=&r,0,1,~{dirflag},~{fpsr},~{flags}"}) -> !rec_22anon2E122
2318+
```
2319+
}];
2320+
2321+
let results = (outs Optional<CIR_AnyType>:$res);
2322+
2323+
let arguments =
2324+
(ins VariadicOfVariadic<AnyType, "operands_segments">:$asm_operands,
2325+
StrAttr:$asm_string, StrAttr:$constraints, UnitAttr:$side_effects,
2326+
CIR_AsmFlavor:$asm_flavor, ArrayAttr:$operand_attrs,
2327+
DenseI32ArrayAttr:$operands_segments);
2328+
2329+
let builders = [OpBuilder<(ins
2330+
"llvm::ArrayRef<mlir::ValueRange>":$asmOperands,
2331+
"llvm::StringRef":$asmString, "llvm::StringRef":$constraints,
2332+
"bool":$sideEffects, "AsmFlavor":$asmFlavor,
2333+
"llvm::ArrayRef<mlir::Attribute>":$operandAttrs)>];
2334+
2335+
let hasCustomAssemblyFormat = 1;
2336+
}
2337+
22572338
//===----------------------------------------------------------------------===//
22582339
// UnreachableOp
22592340
//===----------------------------------------------------------------------===//

clang/include/clang/Driver/Options.td

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3731,14 +3731,20 @@ def fopenmp_relocatable_target : Flag<["-"], "fopenmp-relocatable-target">,
37313731
def fnoopenmp_relocatable_target : Flag<["-"], "fnoopenmp-relocatable-target">,
37323732
Group<f_Group>, Flags<[NoArgumentUnused, HelpHidden]>,
37333733
Visibility<[ClangOption, CC1Option]>;
3734-
def fopenmp_simd : Flag<["-"], "fopenmp-simd">, Group<f_Group>,
3735-
Flags<[NoArgumentUnused]>, Visibility<[ClangOption, CC1Option]>,
3736-
HelpText<"Emit OpenMP code only for SIMD-based constructs.">;
3734+
def fopenmp_simd : Flag<["-"], "fopenmp-simd">,
3735+
Group<f_Group>,
3736+
Flags<[NoArgumentUnused]>,
3737+
Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
3738+
HelpText<"Emit OpenMP code only for SIMD-based constructs.">;
37373739
def fopenmp_enable_irbuilder : Flag<["-"], "fopenmp-enable-irbuilder">, Group<f_Group>,
37383740
Flags<[NoArgumentUnused, HelpHidden]>, Visibility<[ClangOption, CC1Option]>,
37393741
HelpText<"Use the experimental OpenMP-IR-Builder codegen path.">;
3740-
def fno_openmp_simd : Flag<["-"], "fno-openmp-simd">, Group<f_Group>,
3741-
Flags<[NoArgumentUnused]>, Visibility<[ClangOption, CC1Option]>;
3742+
def fno_openmp_simd
3743+
: Flag<["-"], "fno-openmp-simd">,
3744+
Group<f_Group>,
3745+
Flags<[NoArgumentUnused]>,
3746+
Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
3747+
HelpText<"Do not emit code for any OpenMP constructs.">;
37423748
def fopenmp_cuda_mode : Flag<["-"], "fopenmp-cuda-mode">, Group<f_Group>,
37433749
Flags<[NoArgumentUnused, HelpHidden]>, Visibility<[ClangOption, CC1Option]>;
37443750
def fno_openmp_cuda_mode : Flag<["-"], "fno-openmp-cuda-mode">, Group<f_Group>,

0 commit comments

Comments
 (0)