Files
carbon-lang/toolchain/sem_ir/core_interface_kind.def
T
Christopher Di BellaandRichard Smith 2aaa061688 Support detecting begin()/end() methods for range-for loops (#7185)
This commit adds support for range-based for loops using C++ types. It's
currently limited to detecting that `r.begin()` and `r.end()` are
available. We should be able to add full support for methods after #7181
is merged.

Support for ADL is still a work-in-progress, and will be added at a
later time.

---------

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
2026-05-12 19:03:55 +00:00

48 lines
1.9 KiB
C++

// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// This is an X-macro header. It does not use `#include` guards, and instead is
// designed to be `#include`ed after the x-macro is defined in order for its
// inclusion to expand to the desired output. Macro definitions are cleaned up
// at the end of this file.
//
// Supported x-macro is:
// - CARBON_SEM_IR_CORE_INTERFACE_KIND(Name)
// Defines a core interface.
#ifndef CARBON_SEM_IR_CORE_INTERFACE_KIND
#error "Must define CARBON_SEM_IR_CORE_INTERFACE_KIND x-macro to use this file."
#define CARBON_SEM_IR_CORE_INTERFACE_KIND(Name)
#endif
CARBON_SEM_IR_CORE_INTERFACE_KIND(AddAssignWith)
CARBON_SEM_IR_CORE_INTERFACE_KIND(AddWith)
CARBON_SEM_IR_CORE_INTERFACE_KIND(Copy)
CARBON_SEM_IR_CORE_INTERFACE_KIND(CppRangeForIterate)
CARBON_SEM_IR_CORE_INTERFACE_KIND(CppUnsafeDeref)
CARBON_SEM_IR_CORE_INTERFACE_KIND(Dec)
CARBON_SEM_IR_CORE_INTERFACE_KIND(Default)
CARBON_SEM_IR_CORE_INTERFACE_KIND(Destroy)
CARBON_SEM_IR_CORE_INTERFACE_KIND(DivAssignWith)
CARBON_SEM_IR_CORE_INTERFACE_KIND(DivWith)
CARBON_SEM_IR_CORE_INTERFACE_KIND(EqWith)
CARBON_SEM_IR_CORE_INTERFACE_KIND(Inc)
CARBON_SEM_IR_CORE_INTERFACE_KIND(IntFitsIn)
CARBON_SEM_IR_CORE_INTERFACE_KIND(ModAssignWith)
CARBON_SEM_IR_CORE_INTERFACE_KIND(ModWith)
CARBON_SEM_IR_CORE_INTERFACE_KIND(MulAssignWith)
CARBON_SEM_IR_CORE_INTERFACE_KIND(MulWith)
CARBON_SEM_IR_CORE_INTERFACE_KIND(Negate)
CARBON_SEM_IR_CORE_INTERFACE_KIND(OrderedWith)
CARBON_SEM_IR_CORE_INTERFACE_KIND(SubAssignWith)
CARBON_SEM_IR_CORE_INTERFACE_KIND(SubWith)
#ifndef CARBON_SEM_IR_CORE_INTERFACE_EXCLUDE_UNKNOWN
CARBON_SEM_IR_CORE_INTERFACE_KIND(Unknown)
#endif // CARBON_SEM_IR_CORE_INTERFACE_EXCLUDE_UNKNOWN
#undef CARBON_SEM_IR_CORE_INTERFACE_EXCLUDE_UNKNOWN
#undef CARBON_SEM_IR_CORE_INTERFACE_KIND
#undef CARBON_SEM_IR_CORE_INTERFACE_EXCLUDE_UNKNOWN