Skip to content

Commit 25ae464

Browse files
author
iclsrc
committed
Merge from 'main' to 'sycl-web' (85 commits)
2 parents ef8e340 + 01f0425 commit 25ae464

File tree

456 files changed

+10969
-4621
lines changed

Some content is hidden

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

456 files changed

+10969
-4621
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
stage1:
3838
if: github.repository_owner == 'llvm'
3939
runs-on: libcxx-self-hosted-linux
40-
container: ghcr.io/llvm/libcxx-linux-builder:b319dfef21f6c7b0bc6a356d6b9f41a3b3b98ae9
40+
container: ghcr.io/llvm/libcxx-linux-builder:b6bb9dc5abd7c6452c13a53fa8949cb259db459b
4141
continue-on-error: false
4242
strategy:
4343
fail-fast: false
@@ -75,7 +75,7 @@ jobs:
7575
stage2:
7676
if: github.repository_owner == 'llvm'
7777
runs-on: libcxx-self-hosted-linux
78-
container: ghcr.io/llvm/libcxx-linux-builder:b319dfef21f6c7b0bc6a356d6b9f41a3b3b98ae9
78+
container: ghcr.io/llvm/libcxx-linux-builder:b6bb9dc5abd7c6452c13a53fa8949cb259db459b
7979
needs: [ stage1 ]
8080
continue-on-error: false
8181
strategy:
@@ -167,7 +167,7 @@ jobs:
167167
- config: 'generic-msan'
168168
machine: libcxx-self-hosted-linux
169169
runs-on: ${{ matrix.machine }}
170-
container: ghcr.io/llvm/libcxx-linux-builder:b319dfef21f6c7b0bc6a356d6b9f41a3b3b98ae9
170+
container: ghcr.io/llvm/libcxx-linux-builder:b6bb9dc5abd7c6452c13a53fa8949cb259db459b
171171
steps:
172172
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
173173
- name: ${{ matrix.config }}

clang-tools-extra/clang-tidy/bugprone/ComparePointerToMemberVirtualFunctionCheck.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,7 @@ void ComparePointerToMemberVirtualFunctionCheck::check(
7070
// compare with variable which type is pointer to member function.
7171
llvm::SmallVector<SourceLocation, 12U> SameSignatureVirtualMethods{};
7272
const auto *MPT = cast<MemberPointerType>(DRE->getType().getCanonicalType());
73-
const Type *T = MPT->getClass();
74-
if (T == nullptr)
75-
return;
76-
const CXXRecordDecl *RD = T->getAsCXXRecordDecl();
73+
const CXXRecordDecl *RD = MPT->getMostRecentCXXRecordDecl();
7774
if (RD == nullptr)
7875
return;
7976

clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ bool isQualificationConvertiblePointer(QualType From, QualType To,
219219

220220
if (P1->isMemberPointerType())
221221
return P2->isMemberPointerType() &&
222-
P1->getAs<MemberPointerType>()->getClass() ==
223-
P2->getAs<MemberPointerType>()->getClass();
222+
P1->getAs<MemberPointerType>()->getMostRecentCXXRecordDecl() ==
223+
P2->getAs<MemberPointerType>()->getMostRecentCXXRecordDecl();
224224

225225
if (P1->isConstantArrayType())
226226
return P2->isConstantArrayType() &&

clang-tools-extra/clangd/ClangdServer.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,8 @@ void ClangdServer::codeComplete(PathRef File, Position Pos,
455455
CodeCompleteOpts.MainFileSignals = IP->Signals;
456456
CodeCompleteOpts.AllScopes = Config::current().Completion.AllScopes;
457457
CodeCompleteOpts.ArgumentLists = Config::current().Completion.ArgumentLists;
458+
CodeCompleteOpts.InsertIncludes =
459+
Config::current().Completion.HeaderInsertion;
458460
// FIXME(ibiryukov): even if Preamble is non-null, we may want to check
459461
// both the old and the new version in case only one of them matches.
460462
CodeCompleteResult Result = clangd::codeComplete(

clang-tools-extra/clangd/CodeComplete.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ struct CompletionCandidate {
294294
std::optional<llvm::StringRef>
295295
headerToInsertIfAllowed(const CodeCompleteOptions &Opts,
296296
CodeCompletionContext::Kind ContextKind) const {
297-
if (Opts.InsertIncludes == CodeCompleteOptions::NeverInsert ||
297+
if (Opts.InsertIncludes == Config::HeaderInsertionPolicy::NeverInsert ||
298298
RankedIncludeHeaders.empty() ||
299299
!contextAllowsHeaderInsertion(ContextKind))
300300
return std::nullopt;

clang-tools-extra/clangd/CodeComplete.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,8 @@ struct CodeCompleteOptions {
7171
/// Whether to present doc comments as plain-text or markdown.
7272
MarkupKind DocumentationFormat = MarkupKind::PlainText;
7373

74-
enum IncludeInsertion {
75-
IWYU,
76-
NeverInsert,
77-
} InsertIncludes = IncludeInsertion::IWYU;
74+
Config::HeaderInsertionPolicy InsertIncludes =
75+
Config::HeaderInsertionPolicy::IWYU;
7876

7977
/// Whether include insertions for Objective-C code should use #import instead
8078
/// of #include.

clang-tools-extra/clangd/Config.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,20 @@ struct Config {
147147
FullPlaceholders,
148148
};
149149

150+
enum class HeaderInsertionPolicy {
151+
IWYU, // Include what you use
152+
NeverInsert // Never insert headers as part of code completion
153+
};
154+
150155
/// Configures code completion feature.
151156
struct {
152157
/// Whether code completion includes results that are not visible in current
153158
/// scopes.
154159
bool AllScopes = true;
155160
/// controls the completion options for argument lists.
156161
ArgumentListsPolicy ArgumentLists = ArgumentListsPolicy::FullPlaceholders;
162+
/// Controls if headers should be inserted when completions are accepted
163+
HeaderInsertionPolicy HeaderInsertion = HeaderInsertionPolicy::IWYU;
157164
} Completion;
158165

159166
/// Configures hover feature.

clang-tools-extra/clangd/ConfigCompile.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,17 @@ struct FragmentCompiler {
697697
C.Completion.ArgumentLists = *Val;
698698
});
699699
}
700+
if (F.HeaderInsertion) {
701+
if (auto Val =
702+
compileEnum<Config::HeaderInsertionPolicy>("HeaderInsertion",
703+
*F.HeaderInsertion)
704+
.map("IWYU", Config::HeaderInsertionPolicy::IWYU)
705+
.map("Never", Config::HeaderInsertionPolicy::NeverInsert)
706+
.value())
707+
Out.Apply.push_back([Val](const Params &, Config &C) {
708+
C.Completion.HeaderInsertion = *Val;
709+
});
710+
}
700711
}
701712

702713
void compile(Fragment::HoverBlock &&F) {

clang-tools-extra/clangd/ConfigFragment.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,14 @@ struct Fragment {
341341
/// Delimiters: empty pair of delimiters "()" or "<>"
342342
/// FullPlaceholders: full name of both type and parameter
343343
std::optional<Located<std::string>> ArgumentLists;
344+
/// Add #include directives when accepting code completions. Config
345+
/// equivalent of the CLI option '--header-insertion'
346+
/// Valid values are enum Config::HeaderInsertionPolicy values:
347+
/// "IWYU": Include what you use. Insert the owning header for top-level
348+
/// symbols, unless the header is already directly included or the
349+
/// symbol is forward-declared
350+
/// "NeverInsert": Never insert headers
351+
std::optional<Located<std::string>> HeaderInsertion;
344352
};
345353
CompletionBlock Completion;
346354

clang-tools-extra/clangd/ConfigYAML.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ class Parser {
245245
if (auto ArgumentLists = scalarValue(N, "ArgumentLists"))
246246
F.ArgumentLists = *ArgumentLists;
247247
});
248+
Dict.handle("HeaderInsertion", [&](Node &N) {
249+
if (auto HeaderInsertion = scalarValue(N, "HeaderInsertion"))
250+
F.HeaderInsertion = *HeaderInsertion;
251+
});
248252
Dict.parse(N);
249253
}
250254

clang-tools-extra/clangd/tool/ClangdMain.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,19 +251,19 @@ opt<std::string> EnableFunctionArgSnippets{
251251
init("-1"),
252252
};
253253

254-
opt<CodeCompleteOptions::IncludeInsertion> HeaderInsertion{
254+
opt<Config::HeaderInsertionPolicy> HeaderInsertion{
255255
"header-insertion",
256256
cat(Features),
257257
desc("Add #include directives when accepting code completions"),
258258
init(CodeCompleteOptions().InsertIncludes),
259259
values(
260-
clEnumValN(CodeCompleteOptions::IWYU, "iwyu",
260+
clEnumValN(Config::HeaderInsertionPolicy::IWYU, "iwyu",
261261
"Include what you use. "
262262
"Insert the owning header for top-level symbols, unless the "
263263
"header is already directly included or the symbol is "
264264
"forward-declared"),
265265
clEnumValN(
266-
CodeCompleteOptions::NeverInsert, "never",
266+
Config::HeaderInsertionPolicy::NeverInsert, "never",
267267
"Never insert #include directives as part of code completion")),
268268
};
269269

@@ -668,6 +668,7 @@ class FlagsConfigProvider : public config::Provider {
668668
std::optional<Config::ExternalIndexSpec> IndexSpec;
669669
std::optional<Config::BackgroundPolicy> BGPolicy;
670670
std::optional<Config::ArgumentListsPolicy> ArgumentLists;
671+
std::optional<Config::HeaderInsertionPolicy> HeaderInsertionPolicy;
671672

672673
// If --compile-commands-dir arg was invoked, check value and override
673674
// default path.
@@ -712,6 +713,11 @@ class FlagsConfigProvider : public config::Provider {
712713
BGPolicy = Config::BackgroundPolicy::Skip;
713714
}
714715

716+
// If CLI has set never, use that regardless of what the config files have
717+
if (HeaderInsertion == Config::HeaderInsertionPolicy::NeverInsert) {
718+
HeaderInsertionPolicy = Config::HeaderInsertionPolicy::NeverInsert;
719+
}
720+
715721
if (std::optional<bool> Enable = shouldEnableFunctionArgSnippets()) {
716722
ArgumentLists = *Enable ? Config::ArgumentListsPolicy::FullPlaceholders
717723
: Config::ArgumentListsPolicy::Delimiters;
@@ -726,6 +732,8 @@ class FlagsConfigProvider : public config::Provider {
726732
C.Index.Background = *BGPolicy;
727733
if (ArgumentLists)
728734
C.Completion.ArgumentLists = *ArgumentLists;
735+
if (HeaderInsertionPolicy)
736+
C.Completion.HeaderInsertion = *HeaderInsertionPolicy;
729737
if (AllScopesCompletion.getNumOccurrences())
730738
C.Completion.AllScopes = AllScopesCompletion;
731739

clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,7 @@ TEST(CompletionTest, IncludeInsertionPreprocessorIntegrationTests) {
882882
ElementsAre(AllOf(named("X"), insertInclude("\"bar.h\""))));
883883
// Can be disabled via option.
884884
CodeCompleteOptions NoInsertion;
885-
NoInsertion.InsertIncludes = CodeCompleteOptions::NeverInsert;
885+
NoInsertion.InsertIncludes = Config::HeaderInsertionPolicy::NeverInsert;
886886
Results = completions(TU, Test.point(), {Sym}, NoInsertion);
887887
EXPECT_THAT(Results.Completions,
888888
ElementsAre(AllOf(named("X"), Not(insertInclude()))));
@@ -1191,7 +1191,7 @@ TEST(CompletionTest, CommentsOnMembersFromHeaderOverloadBundling) {
11911191
int delta(int i);
11921192
11931193
void epsilon(long l);
1194-
1194+
11951195
/// This one has a comment.
11961196
void epsilon(int i);
11971197
};

clang-tools-extra/test/clang-doc/basic-project.test

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// RUN: rm -rf %t && mkdir -p %t/docs %t/build
22
// RUN: sed 's|$test_dir|%/S|g' %S/Inputs/basic-project/database_template.json > %t/build/compile_commands.json
3+
34
// RUN: clang-doc --format=html --output=%t/docs --executor=all-TUs %t/build/compile_commands.json
45
// RUN: FileCheck %s -input-file=%t/docs/index_json.js -check-prefix=JSON-INDEX
56
// RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/Shape.html -check-prefixes=HTML-SHAPE,SHAPE-NO-REPOSITORY
@@ -14,6 +15,13 @@
1415
// RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/Rectangle.html -check-prefixes=HTML-RECTANGLE,RECTANGLE-REPOSITORY
1516
// RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/Circle.html -check-prefixes=HTML-CIRCLE,CIRCLE-REPOSITORY
1617

18+
// RUN: clang-doc --format=md --output=%t/docs --executor=all-TUs %t/build/compile_commands.json
19+
// RUN: FileCheck %s -input-file=%t/docs/all_files.md -check-prefixes=MD-ALL-FILES
20+
// RUN: FileCheck %s -input-file=%t/docs/index.md -check-prefixes=MD-INDEX
21+
// RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/Shape.md -check-prefixes=MD-SHAPE
22+
// RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/Calculator.md -check-prefixes=MD-CALC
23+
// RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/Rectangle.md -check-prefixes=MD-RECTANGLE
24+
// RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/Circle.md -check-prefixes=MD-CIRCLE
1725

1826
// JSON-INDEX: async function LoadIndex() {
1927
// JSON-INDEX-NEXT: return{
@@ -358,10 +366,6 @@
358366
// MD-SHAPE: **brief** Abstract base class for shapes.
359367
// MD-SHAPE: Provides a common interface for different types of shapes.
360368
// MD-SHAPE: ## Functions
361-
// MD-SHAPE: ### ~Shape
362-
// MD-SHAPE: *public void ~Shape()*
363-
// MD-SHAPE: *Defined at .{{[\/]}}include{{[\/]}}Shape.h#13*
364-
// MD-SHAPE: **brief** Virtual destructor.
365369
// MD-SHAPE: ### area
366370
// MD-SHAPE: *public double area()*
367371
// MD-SHAPE: **brief** Calculates the area of the shape.
@@ -370,6 +374,10 @@
370374
// MD-SHAPE: *public double perimeter()*
371375
// MD-SHAPE: **brief** Calculates the perimeter of the shape.
372376
// MD-SHAPE: **return** double The perimeter of the shape.
377+
// MD-SHAPE: ### ~Shape
378+
// MD-SHAPE: *public void ~Shape()*
379+
// MD-SHAPE: *Defined at .{{[\/]}}include{{[\/]}}Shape.h#13*
380+
// MD-SHAPE: **brief** Virtual destructor.
373381

374382
// MD-ALL-FILES: # All Files
375383
// MD-ALL-FILES: ## [GlobalNamespace](GlobalNamespace{{[\/]}}index.md)

clang/docs/ReleaseNotes.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ C2y Feature Support
134134
``-pedantic`` will no longer diagnose this in either C or C++ modes. This
135135
feature was adopted as applying to obsolete versions of C in WG14 and as a
136136
defect report in WG21 (CWG787).
137-
- Implemented `WG14 N3353 <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3353.htm>_`
137+
- Implemented `WG14 N3353 <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3353.htm>`_
138138
which adds the new ``0o`` and ``0O`` ocal literal prefixes and deprecates
139139
octal literals other than ``0`` which do not start with the new prefix. This
140140
feature is exposed in earlier language modes and in C++ as an extension. The
@@ -271,6 +271,8 @@ Improvements to Clang's diagnostics
271271
as function arguments or return value respectively. Note that
272272
:doc:`ThreadSafetyAnalysis` still does not perform alias analysis. The
273273
feature will be default-enabled with ``-Wthread-safety`` in a future release.
274+
- Clang will now do a better job producing common nested names, when producing
275+
common types for ternary operator, template argument deduction and multiple return auto deduction.
274276
- The ``-Wsign-compare`` warning now treats expressions with bitwise not(~) and minus(-) as signed integers
275277
except for the case where the operand is an unsigned integer
276278
and throws warning if they are compared with unsigned integers (##18878).
@@ -348,6 +350,8 @@ Bug Fixes to C++ Support
348350
- Correctly diagnoses if unresolved using declarations shadows template paramters (#GH129411)
349351
- Clang was previously coalescing volatile writes to members of volatile base class subobjects.
350352
The issue has been addressed by propagating qualifiers during derived-to-base conversions in the AST. (#GH127824)
353+
- Clang now emits the ``-Wunused-variable`` warning when some structured bindings are unused
354+
and the ``[[maybe_unused]]`` attribute is not applied. (#GH125810)
351355

352356
Bug Fixes to AST Handling
353357
^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -491,6 +495,11 @@ Crash and bug fixes
491495
Improvements
492496
^^^^^^^^^^^^
493497

498+
- The checker option ``optin.cplusplus.VirtualCall:PureOnly`` was removed,
499+
because it had been deprecated since 2019 and it is completely useless (it
500+
was kept only for compatibility with pre-2019 versions, setting it to true is
501+
equivalent to completely disabling the checker).
502+
494503
Moved checkers
495504
^^^^^^^^^^^^^^
496505

clang/include/clang/AST/CanonicalType.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,8 @@ struct CanProxyAdaptor<MemberPointerType>
454454
: public CanProxyBase<MemberPointerType> {
455455
LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getPointeeType)
456456
LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(const Type *, getClass)
457+
LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(const CXXRecordDecl *,
458+
getMostRecentCXXRecordDecl)
457459
};
458460

459461
// CanProxyAdaptors for arrays are intentionally unimplemented because

clang/include/clang/AST/ExprCXX.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2777,7 +2777,7 @@ class TypeTraitExpr final
27772777
ArrayRef<TypeSourceInfo *> Args, SourceLocation RParenLoc,
27782778
std::variant<bool, APValue> Value);
27792779

2780-
TypeTraitExpr(EmptyShell Empty) : Expr(TypeTraitExprClass, Empty) {}
2780+
TypeTraitExpr(EmptyShell Empty, bool IsStoredAsBool);
27812781

27822782
size_t numTrailingObjects(OverloadToken<TypeSourceInfo *>) const {
27832783
return getNumArgs();

clang/include/clang/Basic/DiagnosticASTKinds.td

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ let Component = "AST" in {
1111
// Constant expression diagnostics. These (and their users) belong in Sema.
1212
def note_expr_divide_by_zero : Note<"division by zero">;
1313
def note_constexpr_invalid_cast : Note<
14-
"%select{reinterpret_cast|dynamic_cast|%select{this conversion|cast that"
15-
" performs the conversions of a reinterpret_cast}1|cast from %1}0"
14+
"%enum_select<ConstexprInvalidCastKind>{%Reinterpret{reinterpret_cast}|%Dynamic{dynamic_cast}|"
15+
"%ThisConversionOrReinterpret{%select{this conversion|cast that performs the conversions "
16+
"of a reinterpret_cast}1}|%CastFrom{cast from %1}}0"
1617
" is not allowed in a constant expression"
1718
"%select{| in C++ standards before C++20||}0">;
1819
def note_constexpr_invalid_void_star_cast : Note<

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

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,48 @@ def FPAttr : CIR_Attr<"FP", "fp", [TypedAttrInterface]> {
154154
}];
155155
}
156156

157+
158+
//===----------------------------------------------------------------------===//
159+
// ConstArrayAttr
160+
//===----------------------------------------------------------------------===//
161+
162+
def ConstArrayAttr : CIR_Attr<"ConstArray", "const_array", [TypedAttrInterface]> {
163+
let summary = "A constant array from ArrayAttr or StringRefAttr";
164+
let description = [{
165+
An CIR array attribute is an array of literals of the specified attr types.
166+
}];
167+
168+
let parameters = (ins AttributeSelfTypeParameter<"">:$type,
169+
"mlir::Attribute":$elts,
170+
"int":$trailingZerosNum);
171+
172+
// Define a custom builder for the type; that removes the need to pass
173+
// in an MLIRContext instance, as it can be infered from the `type`.
174+
let builders = [
175+
AttrBuilderWithInferredContext<(ins "cir::ArrayType":$type,
176+
"mlir::Attribute":$elts), [{
177+
int zeros = 0;
178+
auto typeSize = mlir::cast<cir::ArrayType>(type).getSize();
179+
if (auto str = mlir::dyn_cast<mlir::StringAttr>(elts))
180+
zeros = typeSize - str.size();
181+
else
182+
zeros = typeSize - mlir::cast<mlir::ArrayAttr>(elts).size();
183+
184+
return $_get(type.getContext(), type, elts, zeros);
185+
}]>
186+
];
187+
188+
// Printing and parsing available in CIRDialect.cpp
189+
let hasCustomAssemblyFormat = 1;
190+
191+
// Enable verifier.
192+
let genVerifyDecl = 1;
193+
194+
let extraClassDeclaration = [{
195+
bool hasTrailingZeros() const { return getTrailingZerosNum() != 0; };
196+
}];
197+
}
198+
157199
//===----------------------------------------------------------------------===//
158200
// ConstPtrAttr
159201
//===----------------------------------------------------------------------===//

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,22 @@ def FuncOp : CIR_Op<"func", [
832832
let hasVerifier = 1;
833833
}
834834

835+
//===----------------------------------------------------------------------===//
836+
// UnreachableOp
837+
//===----------------------------------------------------------------------===//
838+
839+
def UnreachableOp : CIR_Op<"unreachable", [Terminator]> {
840+
let summary = "invoke immediate undefined behavior";
841+
let description = [{
842+
If the program control flow reaches a `cir.unreachable` operation, the
843+
program exhibits undefined behavior immediately. This operation is useful
844+
in cases where the unreachability of a program point needs to be explicitly
845+
marked.
846+
}];
847+
848+
let assemblyFormat = "attr-dict";
849+
}
850+
835851
//===----------------------------------------------------------------------===//
836852
// TrapOp
837853
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)