Skip to content

Commit a0d33c3

Browse files
authored
Merge pull request #85118 from gottesmm/irgen-builtin-fixes
[irgen] Convert emitIRGenBuiltin to use a covered switch.
2 parents 09fec7d + 239807f commit a0d33c3

File tree

3 files changed

+207
-167
lines changed

3 files changed

+207
-167
lines changed

include/swift/AST/Builtins.def

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,11 @@ BUILTIN_BINARY_PREDICATE(FCMP_ULE, "fcmp_ule", "n", FloatOrVector)
209209
BUILTIN_BINARY_PREDICATE(FCMP_UNE, "fcmp_une", "n", FloatOrVector)
210210
BUILTIN_BINARY_PREDICATE(FCMP_UNO, "fcmp_uno", "n", FloatOrVector)
211211

212-
// BUILTIN_SIL_OPERATION - Operations that can be lowered to SIL instructions.
213-
// These have various types.
214-
// Since these operations will be lowered to SIL Instructions, we do not
215-
// assign any attributes on them.
212+
// BUILTIN_SIL_OPERATION - Operations that can be lowered to SIL
213+
// instructions. They can never be invoked via a BuiltinInst and are instead
214+
// expected to just be used by SILGen to emit sequences of non-BuiltinInst
215+
// instructions. These have various types. Since these operations will be
216+
// lowered to SIL Instructions, we do not assign any attributes on them.
216217
#ifndef BUILTIN_SIL_OPERATION
217218
#define BUILTIN_SIL_OPERATION(Id, Name, Overload) BUILTIN(Id, Name, "")
218219
#endif
@@ -558,8 +559,9 @@ BUILTIN_RUNTIME_CALL(ErrorInMain, "errorInMain", "")
558559
/// nominal type is Optional.
559560
BUILTIN_RUNTIME_CALL(IsOptionalType, "isOptional", "")
560561

561-
// BUILTIN_MISC_OPERATION - Miscellaneous operations without a unifying class.
562-
// These have various types.
562+
/// BUILTIN_MISC_OPERATION - Miscellaneous operations without a unifying class.
563+
/// These have various types. They are emitted as BuiltinInst in a standard way
564+
/// by SILGen.
563565
#ifndef BUILTIN_MISC_OPERATION
564566
#define BUILTIN_MISC_OPERATION(Id, Name, Attrs, Overload) \
565567
BUILTIN(Id, Name, Attrs)

0 commit comments

Comments
 (0)