1 //===----- CGCall.h - Encapsulate calling convention details ----*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // These classes wrap the information about a call or function
11 // definition used to handle ABI compliancy.
13 //===----------------------------------------------------------------------===//
15 #ifndef CLANG_CODEGEN_CGCALL_H
16 #define CLANG_CODEGEN_CGCALL_H
18 #include "clang/AST/Type.h"
24 struct AttributeWithIndex;
27 template<typename T, unsigned> class SmallVector;
38 typedef llvm::SmallVector<llvm::AttributeWithIndex, 8> AttributeListType;
40 /// CallArgList - Type for representing both the value and type of
41 /// arguments in a call.
42 typedef llvm::SmallVector<std::pair<RValue, QualType>, 16> CallArgList;
44 /// FunctionArgList - Type for representing both the decl and type
45 /// of parameters to a function. The decl must be either a
46 /// ParmVarDecl or ImplicitParamDecl.
47 typedef llvm::SmallVector<std::pair<const VarDecl*, QualType>,
50 /// CGFunctionInfo - Class to encapsulate the information about a
51 /// function definition.
52 class CGFunctionInfo {
53 llvm::SmallVector<QualType, 16> ArgTypes;
56 typedef llvm::SmallVector<QualType, 16>::const_iterator arg_iterator;
58 CGFunctionInfo(QualType ResTy,
59 const llvm::SmallVector<QualType, 16> &ArgTys);
61 arg_iterator arg_begin() const;
62 arg_iterator arg_end() const;
64 QualType getReturnType() const { return ArgTypes[0]; }
66 } // end namespace CodeGen
67 } // end namespace clang