Skip to content

Commit 4180569

Browse files
committed
Merge from 'main' to 'sycl-web' (21 commits)
CONFLICT (modify/delete): libclc/generic/lib/math/minmag.inc deleted in 6c4dd8d and modified in HEAD. Version HEAD of libclc/generic/lib/math/minmag.inc left in tree.
2 parents ad370ba + 6c4dd8d commit 4180569

File tree

131 files changed

+1043
-522
lines changed

Some content is hidden

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

131 files changed

+1043
-522
lines changed

clang-tools-extra/clangd/index/YAMLSerialization.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ template <> struct MappingTraits<Ref> {
319319
MappingNormalization<NormalizedRefKind, RefKind> NKind(IO, R.Kind);
320320
IO.mapRequired("Kind", NKind->Kind);
321321
IO.mapRequired("Location", R.Location);
322+
IO.mapOptional("Container", R.Container);
322323
}
323324
};
324325

clang-tools-extra/clangd/index/remote/Index.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ message Symbol {
8181
message Ref {
8282
optional SymbolLocation location = 1;
8383
optional uint32 kind = 2;
84+
optional string container = 3;
8485
}
8586

8687
message SymbolInfo {

clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,9 @@ llvm::Expected<clangd::Ref> Marshaller::fromProtobuf(const Ref &Message) {
203203
return Location.takeError();
204204
Result.Location = *Location;
205205
Result.Kind = static_cast<RefKind>(Message.kind());
206+
auto ContainerID = SymbolID::fromStr(Message.container());
207+
if (ContainerID)
208+
Result.Container = *ContainerID;
206209
return Result;
207210
}
208211

@@ -340,6 +343,7 @@ llvm::Expected<Ref> Marshaller::toProtobuf(const clangd::Ref &From) {
340343
if (!Location)
341344
return Location.takeError();
342345
*Result.mutable_location() = *Location;
346+
Result.set_container(From.Container.str());
343347
return Result;
344348
}
345349

clang-tools-extra/clangd/unittests/remote/MarshallingTests.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ TEST(RemoteMarshallingTest, RefSerialization) {
223223
Location.FileURI = testPathURI(
224224
"llvm-project/llvm/clang-tools-extra/clangd/Protocol.h", Strings);
225225
Ref.Location = Location;
226+
Ref.Container = llvm::cantFail(SymbolID::fromStr("0000000000000001"));
226227

227228
Marshaller ProtobufMarshaller(testPath("llvm-project/"),
228229
testPath("llvm-project/"));

clang/docs/ClangFormatStyleOptions.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5195,6 +5195,29 @@ the configuration (without a prefix: ``Auto``).
51955195
Add a space in front of an Objective-C protocol list, i.e. use
51965196
``Foo <Protocol>`` instead of ``Foo<Protocol>``.
51975197

5198+
.. _OneLineFormatOffRegex:
5199+
5200+
**OneLineFormatOffRegex** (``String``) :versionbadge:`clang-format 21` :ref:`<OneLineFormatOffRegex>`
5201+
A regular expression that describes markers for turning formatting off for
5202+
one line. If it matches a comment that is the only token of a line,
5203+
clang-format skips the comment and the next line. Otherwise, clang-format
5204+
skips lines containing a matched token.
5205+
5206+
.. code-block:: c++
5207+
5208+
// OneLineFormatOffRegex: ^(// NOLINT|logger$)
5209+
// results in the output below:
5210+
int a;
5211+
int b ; // NOLINT
5212+
int c;
5213+
// NOLINTNEXTLINE
5214+
int d ;
5215+
int e;
5216+
s = "// NOLINT";
5217+
logger() ;
5218+
logger2();
5219+
my_logger();
5220+
51985221
.. _PPIndentWidth:
51995222

52005223
**PPIndentWidth** (``Integer``) :versionbadge:`clang-format 13` :ref:`<PPIndentWidth>`

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,7 @@ clang-format
746746
top of the file.
747747
- Add ``EnumTrailingComma`` option for inserting/removing commas at the end of
748748
``enum`` enumerator lists.
749+
- Add ``OneLineFormatOffRegex`` option for turning formatting off for one line.
749750

750751
libclang
751752
--------

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

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def ConstArrayAttr : CIR_Attr<"ConstArray", "const_array", [TypedAttrInterface]>
204204
}]>
205205
];
206206

207-
// Printing and parsing available in CIRDialect.cpp
207+
// Printing and parsing available in CIRAttrs.cpp
208208
let hasCustomAssemblyFormat = 1;
209209

210210
// Enable verifier.
@@ -215,6 +215,38 @@ def ConstArrayAttr : CIR_Attr<"ConstArray", "const_array", [TypedAttrInterface]>
215215
}];
216216
}
217217

218+
//===----------------------------------------------------------------------===//
219+
// ConstVectorAttr
220+
//===----------------------------------------------------------------------===//
221+
222+
def ConstVectorAttr : CIR_Attr<"ConstVector", "const_vector",
223+
[TypedAttrInterface]> {
224+
let summary = "A constant vector from ArrayAttr";
225+
let description = [{
226+
A CIR vector attribute is an array of literals of the specified attribute
227+
types.
228+
}];
229+
230+
let parameters = (ins AttributeSelfTypeParameter<"">:$type,
231+
"mlir::ArrayAttr":$elts);
232+
233+
// Define a custom builder for the type; that removes the need to pass in an
234+
// MLIRContext instance, as it can be inferred from the `type`.
235+
let builders = [
236+
AttrBuilderWithInferredContext<(ins "cir::VectorType":$type,
237+
"mlir::ArrayAttr":$elts), [{
238+
return $_get(type.getContext(), type, elts);
239+
}]>
240+
];
241+
242+
let assemblyFormat = [{
243+
`<` $elts `>`
244+
}];
245+
246+
// Enable verifier.
247+
let genVerifyDecl = 1;
248+
}
249+
218250
//===----------------------------------------------------------------------===//
219251
// ConstPtrAttr
220252
//===----------------------------------------------------------------------===//

clang/include/clang/Format/Format.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3654,6 +3654,27 @@ struct FormatStyle {
36543654
/// \version 3.7
36553655
bool ObjCSpaceBeforeProtocolList;
36563656

3657+
/// A regular expression that describes markers for turning formatting off for
3658+
/// one line. If it matches a comment that is the only token of a line,
3659+
/// clang-format skips the comment and the next line. Otherwise, clang-format
3660+
/// skips lines containing a matched token.
3661+
/// \code
3662+
/// // OneLineFormatOffRegex: ^(// NOLINT|logger$)
3663+
/// // results in the output below:
3664+
/// int a;
3665+
/// int b ; // NOLINT
3666+
/// int c;
3667+
/// // NOLINTNEXTLINE
3668+
/// int d ;
3669+
/// int e;
3670+
/// s = "// NOLINT";
3671+
/// logger() ;
3672+
/// logger2();
3673+
/// my_logger();
3674+
/// \endcode
3675+
/// \version 21
3676+
std::string OneLineFormatOffRegex;
3677+
36573678
/// Different ways to try to fit all constructor initializers on a line.
36583679
enum PackConstructorInitializersStyle : int8_t {
36593680
/// Always put each constructor initializer on its own line.
@@ -5399,6 +5420,7 @@ struct FormatStyle {
53995420
ObjCPropertyAttributeOrder == R.ObjCPropertyAttributeOrder &&
54005421
ObjCSpaceAfterProperty == R.ObjCSpaceAfterProperty &&
54015422
ObjCSpaceBeforeProtocolList == R.ObjCSpaceBeforeProtocolList &&
5423+
OneLineFormatOffRegex == R.OneLineFormatOffRegex &&
54025424
PackConstructorInitializers == R.PackConstructorInitializers &&
54035425
PenaltyBreakAssignment == R.PenaltyBreakAssignment &&
54045426
PenaltyBreakBeforeFirstCallParameter ==

0 commit comments

Comments
 (0)