semantics_builtin_kind.cpp 765 B

1234567891011121314151617181920212223
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. #include "toolchain/semantics/semantics_builtin_kind.h"
  5. namespace Carbon {
  6. CARBON_DEFINE_ENUM_CLASS_NAMES(SemanticsBuiltinKind) = {
  7. #define CARBON_SEMANTICS_BUILTIN_KIND_NAME(Name) \
  8. CARBON_ENUM_CLASS_NAME_STRING(Name)
  9. #include "toolchain/semantics/semantics_builtin_kind.def"
  10. };
  11. auto SemanticsBuiltinKind::label() -> llvm::StringRef {
  12. static constexpr llvm::StringLiteral Labels[] = {
  13. #define CARBON_SEMANTICS_BUILTIN_KIND(Name, Type, Label) Label,
  14. #include "toolchain/semantics/semantics_builtin_kind.def"
  15. };
  16. return Labels[AsInt()];
  17. }
  18. } // namespace Carbon