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 ParamAttrsWithIndex;
27 template<typename T, unsigned> class SmallVector;
37 typedef llvm::SmallVector<llvm::ParamAttrsWithIndex, 8> ParamAttrListType;
39 /// CallArgList - Type for representing both the value and type of
40 /// arguments in a call.
41 typedef llvm::SmallVector<std::pair<RValue, QualType>, 16> CallArgList;
43 /// CGFunctionInfo - Class to encapsulate the information about a
44 /// function definition.
45 class CGFunctionInfo {
46 /// TheDecl - The decl we are storing information for. This is
47 /// either a Function or ObjCMethod Decl.
50 llvm::SmallVector<QualType, 16> ArgTypes;
53 CGFunctionInfo(const FunctionDecl *FD);
54 CGFunctionInfo(const ObjCMethodDecl *MD,
55 const ASTContext &Context);
57 const Decl* getDecl() const { return TheDecl; }
59 void constructParamAttrList(ParamAttrListType &Args) const;
62 /// CGCallInfo - Class to encapsulate the arguments and clang types
66 const CallArgList &Args;
68 llvm::SmallVector<QualType, 16> ArgTypes;
71 CGCallInfo(QualType _ResultType, const CallArgList &Args);
73 void constructParamAttrList(ParamAttrListType &Args) const;
75 } // end namespace CodeGen
76 } // end namespace clang