clang  3.9.0
CodeGenABITypes.cpp
Go to the documentation of this file.
1 //==--- CodeGenABITypes.cpp - Convert Clang types to LLVM types for ABI ----==//
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 // CodeGenABITypes is a simple interface for getting LLVM types for
11 // the parameters and the return value of a function given the Clang
12 // types.
13 //
14 // The class is implemented as a public wrapper around the private
15 // CodeGenTypes class in lib/CodeGen.
16 //
17 //===----------------------------------------------------------------------===//
18 
20 #include "CodeGenModule.h"
25 
26 using namespace clang;
27 using namespace CodeGen;
28 
29 const CGFunctionInfo &
31  const ObjCMethodDecl *MD,
32  QualType receiverType) {
33  return CGM.getTypes().arrangeObjCMessageSendSignature(MD, receiverType);
34 }
35 
36 const CGFunctionInfo &
39  const FunctionDecl *FD) {
40  return CGM.getTypes().arrangeFreeFunctionType(Ty, FD);
41 }
42 
43 const CGFunctionInfo &
46  return CGM.getTypes().arrangeFreeFunctionType(Ty);
47 }
48 
49 const CGFunctionInfo &
51  const CXXRecordDecl *RD,
52  const FunctionProtoType *FTP,
53  const CXXMethodDecl *MD) {
54  return CGM.getTypes().arrangeCXXMethodType(RD, FTP, MD);
55 }
56 
57 const CGFunctionInfo &
59  CanQualType returnType,
60  ArrayRef<CanQualType> argTypes,
62  RequiredArgs args) {
63  return CGM.getTypes().arrangeLLVMFunctionInfo(
64  returnType, /*IsInstanceMethod=*/false, /*IsChainCall=*/false, argTypes,
65  info, {}, args);
66 }
FunctionDecl - An instance of this class is created to represent a function declaration or definition...
Definition: Decl.h:1561
A (possibly-)qualified type.
Definition: Type.h:598
const CGFunctionInfo & arrangeFreeFunctionType(CanQual< FunctionProtoType > Ty, const FunctionDecl *FD)
Arrange the argument and result information for a value of the given freestanding function type...
Definition: CGCall.cpp:160
const CGFunctionInfo & arrangeCXXMethodType(const CXXRecordDecl *RD, const FunctionProtoType *FTP, const CXXMethodDecl *MD)
Arrange the argument and result information for a call to an unknown C++ non-static member function o...
Definition: CGCall.cpp:212
ObjCMethodDecl - Represents an instance or class method declaration.
Definition: DeclObjC.h:113
const CGFunctionInfo & arrangeCXXMethodType(CodeGenModule &CGM, const CXXRecordDecl *RD, const FunctionProtoType *FTP, const CXXMethodDecl *MD)
const CGFunctionInfo & arrangeFreeFunctionType(CodeGenModule &CGM, CanQual< FunctionProtoType > Ty, const FunctionDecl *FD)
const CGFunctionInfo & arrangeObjCMessageSendSignature(const ObjCMethodDecl *MD, QualType receiverType)
Arrange the argument and result information for the function type through which to perform a send to ...
Definition: CGCall.cpp:418
const CGFunctionInfo & arrangeLLVMFunctionInfo(CanQualType returnType, bool instanceMethod, bool chainCall, ArrayRef< CanQualType > argTypes, FunctionType::ExtInfo info, ArrayRef< FunctionProtoType::ExtParameterInfo > paramInfos, RequiredArgs args)
"Arrange" the LLVM information for a call or type with the given signature.
Definition: CGCall.cpp:672
const CGFunctionInfo & arrangeObjCMessageSendSignature(CodeGenModule &CGM, const ObjCMethodDecl *MD, QualType receiverType)
Represents a prototype with parameter type info, e.g.
Definition: Type.h:3073
A class for recording the number of arguments that a function signature requires. ...
Represents a static or instance method of a struct/union/class.
Definition: DeclCXX.h:1736
const CGFunctionInfo & arrangeFreeFunctionCall(CodeGenModule &CGM, CanQualType returnType, ArrayRef< CanQualType > argTypes, FunctionType::ExtInfo info, RequiredArgs args)
CGFunctionInfo - Class to encapsulate the information about a function definition.
This class organizes the cross-function state that is used while generating LLVM code.
Represents a C++ struct/union/class.
Definition: DeclCXX.h:263
A class which abstracts out some details necessary for making a call.
Definition: Type.h:2904