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_CODEGENABITYPES_H
25 #define LLVM_CLANG_CODEGEN_CODEGENABITYPES_H
27 #include "clang/AST/CanonicalType.h"
28 #include "clang/AST/Type.h"
29 #include "clang/CodeGen/CGFunctionInfo.h"
41 class CoverageSourceInfo;
42 class DiagnosticsEngine;
43 class HeaderSearchOptions;
45 class PreprocessorOptions;
54 CodeGenABITypes(ASTContext &C, llvm::Module &M,
55 CoverageSourceInfo *CoverageInfo = nullptr);
58 /// These methods all forward to methods in the private implementation class
61 const CGFunctionInfo &arrangeObjCMessageSendSignature(
62 const ObjCMethodDecl *MD,
63 QualType receiverType);
64 const CGFunctionInfo &arrangeFreeFunctionType(CanQual<FunctionProtoType> Ty,
65 const FunctionDecl *FD);
66 const CGFunctionInfo &arrangeFreeFunctionType(
67 CanQual<FunctionNoProtoType> Ty);
68 const CGFunctionInfo &arrangeCXXMethodType(const CXXRecordDecl *RD,
69 const FunctionProtoType *FTP,
70 const CXXMethodDecl *MD);
71 const CGFunctionInfo &arrangeFreeFunctionCall(CanQualType returnType,
72 ArrayRef<CanQualType> argTypes,
73 FunctionType::ExtInfo info,
77 /// Default CodeGenOptions object used to initialize the
78 /// CodeGenModule and otherwise not used. More specifically, it is
79 /// not used in ABI type generation, so none of the options matter.
80 std::unique_ptr<CodeGenOptions> CGO;
81 std::unique_ptr<HeaderSearchOptions> HSO;
82 std::unique_ptr<PreprocessorOptions> PPO;
84 /// The CodeGenModule we use get to the CodeGenTypes object.
85 std::unique_ptr<CodeGen::CodeGenModule> CGM;
88 } // end namespace CodeGen
89 } // end namespace clang