//
// It allows other clients, like LLDB, to determine the LLVM types that are
// actually used in function calls, which makes it possible to then determine
-// the acutal ABI locations (e.g. registers, stack locations, etc.) that
+// the actual ABI locations (e.g. registers, stack locations, etc.) that
// these parameters are stored in.
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_CLANG_CODEGEN_ABITYPES_H
-#define LLVM_CLANG_CODEGEN_ABITYPES_H
+#ifndef LLVM_CLANG_CODEGEN_CODEGENABITYPES_H
+#define LLVM_CLANG_CODEGEN_CODEGENABITYPES_H
#include "clang/AST/CanonicalType.h"
#include "clang/AST/Type.h"
namespace llvm {
class DataLayout;
class Module;
+ class FunctionType;
+ class Type;
}
namespace clang {
class ASTContext;
class CXXRecordDecl;
+class CXXMethodDecl;
class CodeGenOptions;
+class CoverageSourceInfo;
class DiagnosticsEngine;
+class HeaderSearchOptions;
class ObjCMethodDecl;
-class CoverageSourceInfo;
+class PreprocessorOptions;
namespace CodeGen {
class CGFunctionInfo;
class CodeGenModule;
-class CodeGenABITypes
-{
-public:
- CodeGenABITypes(ASTContext &C, llvm::Module &M, const llvm::DataLayout &TD,
- CoverageSourceInfo *CoverageInfo = nullptr);
- ~CodeGenABITypes();
+const CGFunctionInfo &arrangeObjCMessageSendSignature(CodeGenModule &CGM,
+ const ObjCMethodDecl *MD,
+ QualType receiverType);
+
+const CGFunctionInfo &arrangeFreeFunctionType(CodeGenModule &CGM,
+ CanQual<FunctionProtoType> Ty,
+ const FunctionDecl *FD);
+
+const CGFunctionInfo &arrangeFreeFunctionType(CodeGenModule &CGM,
+ CanQual<FunctionNoProtoType> Ty);
- /// These methods all forward to methods in the private implementation class
- /// CodeGenTypes.
+const CGFunctionInfo &arrangeCXXMethodType(CodeGenModule &CGM,
+ const CXXRecordDecl *RD,
+ const FunctionProtoType *FTP,
+ const CXXMethodDecl *MD);
- const CGFunctionInfo &arrangeObjCMessageSendSignature(
- const ObjCMethodDecl *MD,
- QualType receiverType);
- const CGFunctionInfo &arrangeFreeFunctionType(
- CanQual<FunctionProtoType> Ty);
- const CGFunctionInfo &arrangeFreeFunctionType(
- CanQual<FunctionNoProtoType> Ty);
- const CGFunctionInfo &arrangeCXXMethodType(const CXXRecordDecl *RD,
- const FunctionProtoType *FTP);
- const CGFunctionInfo &arrangeFreeFunctionCall(CanQualType returnType,
- ArrayRef<CanQualType> argTypes,
- FunctionType::ExtInfo info,
- RequiredArgs args);
+const CGFunctionInfo &arrangeFreeFunctionCall(CodeGenModule &CGM,
+ CanQualType returnType,
+ ArrayRef<CanQualType> argTypes,
+ FunctionType::ExtInfo info,
+ RequiredArgs args);
-private:
- /// Default CodeGenOptions object used to initialize the
- /// CodeGenModule and otherwise not used. More specifically, it is
- /// not used in ABI type generation, so none of the options matter.
- CodeGenOptions *CGO;
+// Returns null if the function type is incomplete and can't be lowered.
+llvm::FunctionType *convertFreeFunctionType(CodeGenModule &CGM,
+ const FunctionDecl *FD);
- /// The CodeGenModule we use get to the CodeGenTypes object.
- CodeGen::CodeGenModule *CGM;
-};
+llvm::Type *convertTypeForMemory(CodeGenModule &CGM, QualType T);
} // end namespace CodeGen
} // end namespace clang