LLVM API Documentation
00001 //===-- llvm/CallingConv.h - LLVM Calling Conventions -----------*- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file was developed by the LLVM research group and is distributed under 00006 // the University of Illinois Open Source License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // This file defines LLVM's set of calling conventions. 00011 // 00012 //===----------------------------------------------------------------------===// 00013 00014 #ifndef LLVM_CALLINGCONV_H 00015 #define LLVM_CALLINGCONV_H 00016 00017 namespace llvm { 00018 00019 /// CallingConv Namespace - This namespace contains an enum with a value for 00020 /// the well-known calling conventions. 00021 /// 00022 namespace CallingConv { 00023 /// A set of enums which specify the assigned numeric values for known llvm 00024 /// calling conventions. 00025 /// @brief LLVM Calling Convention Representation 00026 enum ID { 00027 // C - The default llvm calling convention, compatible with C. This 00028 // convention is the only calling convention that supports varargs calls. 00029 // As with typical C calling conventions, the callee/caller have to tolerate 00030 // certain amounts of prototype mismatch. 00031 C = 0, 00032 00033 /// CSRet - C Struct Return calling convention. This convention requires 00034 /// that the function return void and take a pointer as the first argument 00035 /// of the struct. This is used by targets which need to distinguish 00036 /// between C functions returning a structure, and C functions taking a 00037 /// structure pointer as the first argument to the function. 00038 CSRet = 1, 00039 00040 00041 // Generic LLVM calling conventions. None of these calling conventions 00042 // support varargs calls, and all assume that the caller and callee 00043 // prototype exactly match. 00044 00045 // Fast - This calling convention attempts to make calls as fast as possible 00046 // (e.g. by passing things in registers). 00047 Fast = 8, 00048 00049 // Cold - This calling convention attempts to make code in the caller as 00050 // efficient as possible under the assumption that the call is not commonly 00051 // executed. As such, these calls often preserve all registers so that the 00052 // call does not break any live ranges in the caller side. 00053 Cold = 9, 00054 00055 // Target - This is the start of the target-specific calling conventions, 00056 // e.g. fastcall and thiscall on X86. 00057 FirstTargetCC = 64 00058 }; 00059 } // End CallingConv namespace 00060 00061 } // End llvm namespace 00062 00063 #endif