Juergen Ributzka | 9969d3e | 2013-11-08 23:28:16 +0000 | [diff] [blame] | 1 | //=== X86CallingConv.h - X86 Custom Calling Convention Routines -*- 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 contains the custom routines for the X86 Calling Convention that |
| 11 | // aren't done by tablegen. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
Benjamin Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 15 | #ifndef LLVM_LIB_TARGET_X86_X86CALLINGCONV_H |
| 16 | #define LLVM_LIB_TARGET_X86_X86CALLINGCONV_H |
Juergen Ributzka | 9969d3e | 2013-11-08 23:28:16 +0000 | [diff] [blame] | 17 | |
| 18 | #include "llvm/CodeGen/CallingConvLower.h" |
| 19 | #include "llvm/IR/CallingConv.h" |
| 20 | |
| 21 | namespace llvm { |
| 22 | |
Reid Kleckner | 9ccce99 | 2014-10-28 01:29:26 +0000 | [diff] [blame] | 23 | inline bool CC_X86_32_VectorCallIndirect(unsigned &ValNo, MVT &ValVT, |
| 24 | MVT &LocVT, |
| 25 | CCValAssign::LocInfo &LocInfo, |
| 26 | ISD::ArgFlagsTy &ArgFlags, |
| 27 | CCState &State) { |
| 28 | // Similar to CCPassIndirect, with the addition of inreg. |
| 29 | LocVT = MVT::i32; |
| 30 | LocInfo = CCValAssign::Indirect; |
| 31 | ArgFlags.setInReg(); |
| 32 | return false; // Continue the search, but now for i32. |
| 33 | } |
| 34 | |
| 35 | |
Juergen Ributzka | 9969d3e | 2013-11-08 23:28:16 +0000 | [diff] [blame] | 36 | inline bool CC_X86_AnyReg_Error(unsigned &, MVT &, MVT &, |
| 37 | CCValAssign::LocInfo &, ISD::ArgFlagsTy &, |
| 38 | CCState &) { |
| 39 | llvm_unreachable("The AnyReg calling convention is only supported by the " \ |
| 40 | "stackmap and patchpoint intrinsics."); |
| 41 | // gracefully fallback to X86 C calling convention on Release builds. |
| 42 | return false; |
| 43 | } |
| 44 | |
Alexander Kornienko | f00654e | 2015-06-23 09:49:53 +0000 | [diff] [blame] | 45 | } // End llvm namespace |
Juergen Ributzka | 9969d3e | 2013-11-08 23:28:16 +0000 | [diff] [blame] | 46 | |
| 47 | #endif |
| 48 | |