1 //==---- CodeGenABITypes.h - Convert Clang types to LLVM types for ABI -----==//
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 // CodeGenABITypes is a simple interface for getting LLVM types for
11 // the parameters and the return value of a function given the Clang
14 // The class is implemented as a public wrapper around the private
15 // CodeGenTypes class in lib/CodeGen.
17 // It allows other clients, like LLDB, to determine the LLVM types that are
18 // actually used in function calls, which makes it possible to then determine
19 // the acutal ABI locations (e.g. registers, stack locations, etc.) that
20 // these parameters are stored in.
22 //===----------------------------------------------------------------------===//
24 #ifndef LLVM_CLANG_CODEGEN_ABITYPES_H
25 #define LLVM_CLANG_CODEGEN_ABITYPES_H
27 #include "clang/AST/CanonicalType.h"
28 #include "clang/AST/Type.h"
29 #include "clang/CodeGen/CGFunctionInfo.h"
40 class DiagnosticsEngine;
50 CodeGenABITypes(ASTContext &C, const CodeGenOptions &CodeGenOpts,
51 llvm::Module &M, const llvm::DataLayout &TD,
52 DiagnosticsEngine &Diags);
56 /// These methods all forward to methods in the private implementation class
59 const CGFunctionInfo &arrangeObjCMessageSendSignature(
60 const ObjCMethodDecl *MD,
61 QualType receiverType);
62 const CGFunctionInfo &arrangeFreeFunctionType(
63 CanQual<FunctionProtoType> Ty);
64 const CGFunctionInfo &arrangeFreeFunctionType(
65 CanQual<FunctionNoProtoType> Ty);
66 const CGFunctionInfo &arrangeCXXMethodType(const CXXRecordDecl *RD,
67 const FunctionProtoType *FTP);
68 const CGFunctionInfo &arrangeLLVMFunctionInfo(CanQualType returnType,
69 llvm::ArrayRef<CanQualType> argTypes,
70 FunctionType::ExtInfo info,
74 CodeGen::CodeGenModule *CGM;
77 } // end namespace CodeGen
78 } // end namespace clang