Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

129 lines
4.7 KiB

  1. //===-- llvm/CallingConv.h - LLVM Calling Conventions -----------*- C++ -*-===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // License. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. //
  10. // This file defines LLVM's set of calling conventions.
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #ifndef LLVM_IR_CALLINGCONV_H
  14. #define LLVM_IR_CALLINGCONV_H
  15. namespace llvm {
  16. /// CallingConv Namespace - This namespace contains an enum with a value for
  17. /// the well-known calling conventions.
  18. ///
  19. namespace CallingConv {
  20. /// A set of enums which specify the assigned numeric values for known llvm
  21. /// calling conventions.
  22. /// @brief LLVM Calling Convention Representation
  23. enum ID {
  24. /// C - The default llvm calling convention, compatible with C. This
  25. /// convention is the only calling convention that supports varargs calls.
  26. /// As with typical C calling conventions, the callee/caller have to
  27. /// tolerate certain amounts of prototype mismatch.
  28. C = 0,
  29. // Generic LLVM calling conventions. None of these calling conventions
  30. // support varargs calls, and all assume that the caller and callee
  31. // prototype exactly match.
  32. /// Fast - This calling convention attempts to make calls as fast as
  33. /// possible (e.g. by passing things in registers).
  34. Fast = 8,
  35. // Cold - This calling convention attempts to make code in the caller as
  36. // efficient as possible under the assumption that the call is not commonly
  37. // executed. As such, these calls often preserve all registers so that the
  38. // call does not break any live ranges in the caller side.
  39. Cold = 9,
  40. // GHC - Calling convention used by the Glasgow Haskell Compiler (GHC).
  41. GHC = 10,
  42. // HiPE - Calling convention used by the High-Performance Erlang Compiler
  43. // (HiPE).
  44. HiPE = 11,
  45. // Target - This is the start of the target-specific calling conventions,
  46. // e.g. fastcall and thiscall on X86.
  47. FirstTargetCC = 64,
  48. /// X86_StdCall - stdcall is the calling conventions mostly used by the
  49. /// Win32 API. It is basically the same as the C convention with the
  50. /// difference in that the callee is responsible for popping the arguments
  51. /// from the stack.
  52. X86_StdCall = 64,
  53. /// X86_FastCall - 'fast' analog of X86_StdCall. Passes first two arguments
  54. /// in ECX:EDX registers, others - via stack. Callee is responsible for
  55. /// stack cleaning.
  56. X86_FastCall = 65,
  57. /// ARM_APCS - ARM Procedure Calling Standard calling convention (obsolete,
  58. /// but still used on some targets).
  59. ARM_APCS = 66,
  60. /// ARM_AAPCS - ARM Architecture Procedure Calling Standard calling
  61. /// convention (aka EABI). Soft float variant.
  62. ARM_AAPCS = 67,
  63. /// ARM_AAPCS_VFP - Same as ARM_AAPCS, but uses hard floating point ABI.
  64. ARM_AAPCS_VFP = 68,
  65. /// MSP430_INTR - Calling convention used for MSP430 interrupt routines.
  66. MSP430_INTR = 69,
  67. /// X86_ThisCall - Similar to X86_StdCall. Passes first argument in ECX,
  68. /// others via stack. Callee is responsible for stack cleaning. MSVC uses
  69. /// this by default for methods in its ABI.
  70. X86_ThisCall = 70,
  71. /// PTX_Kernel - Call to a PTX kernel.
  72. /// Passes all arguments in parameter space.
  73. PTX_Kernel = 71,
  74. /// PTX_Device - Call to a PTX device function.
  75. /// Passes all arguments in register or parameter space.
  76. PTX_Device = 72,
  77. /// MBLAZE_INTR - Calling convention used for MBlaze interrupt routines.
  78. MBLAZE_INTR = 73,
  79. /// MBLAZE_INTR - Calling convention used for MBlaze interrupt support
  80. /// routines (i.e. GCC's save_volatiles attribute).
  81. MBLAZE_SVOL = 74,
  82. /// SPIR_FUNC - Calling convention for SPIR non-kernel device functions.
  83. /// No lowering or expansion of arguments.
  84. /// Structures are passed as a pointer to a struct with the byval attribute.
  85. /// Functions can only call SPIR_FUNC and SPIR_KERNEL functions.
  86. /// Functions can only have zero or one return values.
  87. /// Variable arguments are not allowed, except for printf.
  88. /// How arguments/return values are lowered are not specified.
  89. /// Functions are only visible to the devices.
  90. SPIR_FUNC = 75,
  91. /// SPIR_KERNEL - Calling convention for SPIR kernel functions.
  92. /// Inherits the restrictions of SPIR_FUNC, except
  93. /// Cannot have non-void return values.
  94. /// Cannot have variable arguments.
  95. /// Can also be called by the host.
  96. /// Is externally visible.
  97. SPIR_KERNEL = 76,
  98. /// Intel_OCL_BI - Calling conventions for Intel OpenCL built-ins
  99. Intel_OCL_BI = 77
  100. };
  101. } // End CallingConv namespace
  102. } // End llvm namespace
  103. #endif