builtin_function_kind.def 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. //
  5. // This is an X-macro header. It does not use `#include` guards, and instead is
  6. // designed to be `#include`ed after the x-macro is defined in order for its
  7. // inclusion to expand to the desired output. Macro definitions are cleaned up
  8. // at the end of this file.
  9. //
  10. // Supported x-macro is:
  11. // - CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(Name)
  12. // Defines a builtin function type.
  13. #if !defined(CARBON_SEM_IR_BUILTIN_FUNCTION_KIND)
  14. #error \
  15. "Must define CARBON_SEM_IR_BUILTIN_FUNCTION_KIND x-macro to use this file."
  16. #endif
  17. CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(None)
  18. // Type factories.
  19. CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(IntMakeType32)
  20. CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(IntMakeTypeSigned)
  21. CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(IntMakeTypeUnsigned)
  22. CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(FloatMakeType)
  23. CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(BoolMakeType)
  24. // Integer arithmetic.
  25. CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(IntNegate)
  26. CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(IntAdd)
  27. CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(IntSub)
  28. CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(IntMul)
  29. CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(IntDiv)
  30. CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(IntMod)
  31. // Integer bitwise.
  32. CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(IntComplement)
  33. CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(IntAnd)
  34. CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(IntOr)
  35. CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(IntXor)
  36. CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(IntLeftShift)
  37. CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(IntRightShift)
  38. // Integer comparison.
  39. CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(IntEq)
  40. CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(IntNeq)
  41. CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(IntLess)
  42. CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(IntLessEq)
  43. CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(IntGreater)
  44. CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(IntGreaterEq)
  45. #undef CARBON_SEM_IR_BUILTIN_FUNCTION_KIND