• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //==---- CodeGenABITypes.h - 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 // 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.
21 //
22 //===----------------------------------------------------------------------===//
23 
24 #ifndef LLVM_CLANG_CODEGEN_CODEGENABITYPES_H
25 #define LLVM_CLANG_CODEGEN_CODEGENABITYPES_H
26 
27 #include "clang/AST/CanonicalType.h"
28 #include "clang/AST/Type.h"
29 #include "clang/CodeGen/CGFunctionInfo.h"
30 
31 namespace llvm {
32   class DataLayout;
33   class Module;
34 }
35 
36 namespace clang {
37 class ASTContext;
38 class CXXRecordDecl;
39 class CXXMethodDecl;
40 class CodeGenOptions;
41 class CoverageSourceInfo;
42 class DiagnosticsEngine;
43 class HeaderSearchOptions;
44 class ObjCMethodDecl;
45 class PreprocessorOptions;
46 
47 namespace CodeGen {
48 class CGFunctionInfo;
49 class CodeGenModule;
50 
51 const CGFunctionInfo &arrangeObjCMessageSendSignature(CodeGenModule &CGM,
52                                                       const ObjCMethodDecl *MD,
53                                                       QualType receiverType);
54 
55 const CGFunctionInfo &arrangeFreeFunctionType(CodeGenModule &CGM,
56                                               CanQual<FunctionProtoType> Ty,
57                                               const FunctionDecl *FD);
58 
59 const CGFunctionInfo &arrangeFreeFunctionType(CodeGenModule &CGM,
60                                               CanQual<FunctionNoProtoType> Ty);
61 
62 const CGFunctionInfo &arrangeCXXMethodType(CodeGenModule &CGM,
63                                            const CXXRecordDecl *RD,
64                                            const FunctionProtoType *FTP,
65                                            const CXXMethodDecl *MD);
66 
67 const CGFunctionInfo &arrangeFreeFunctionCall(CodeGenModule &CGM,
68                                               CanQualType returnType,
69                                               ArrayRef<CanQualType> argTypes,
70                                               FunctionType::ExtInfo info,
71                                               RequiredArgs args);
72 
73 }  // end namespace CodeGen
74 }  // end namespace clang
75 
76 #endif
77