summaryrefslogtreecommitdiff
path: root/clang-r353983/include/clang/CodeGen/CodeGenABITypes.h
diff options
context:
space:
mode:
authorRalf Luther <luther.ralf@gmail.com>2019-03-27 20:23:17 +0000
committerGerrit Code Review <gerrit2@aicp-server-3>2019-03-27 20:23:17 +0000
commit1ce3a9d272e564b22a1333a1e36a3d3ab7cfab01 (patch)
tree391382eadd4fec5bb480f2e8934fa352770221d1 /clang-r353983/include/clang/CodeGen/CodeGenABITypes.h
parentd1d48b140bafaa8a50107292f5fce95562575765 (diff)
parent4f56932d3416ac03f646bc1a611b3135fec2fe08 (diff)
Merge "Update prebuilt Clang to r353983." into p9.0HEADp9.0-backupp9.0
Diffstat (limited to 'clang-r353983/include/clang/CodeGen/CodeGenABITypes.h')
-rw-r--r--clang-r353983/include/clang/CodeGen/CodeGenABITypes.h89
1 files changed, 89 insertions, 0 deletions
diff --git a/clang-r353983/include/clang/CodeGen/CodeGenABITypes.h b/clang-r353983/include/clang/CodeGen/CodeGenABITypes.h
new file mode 100644
index 00000000..febb25aa
--- /dev/null
+++ b/clang-r353983/include/clang/CodeGen/CodeGenABITypes.h
@@ -0,0 +1,89 @@
+//==---- CodeGenABITypes.h - Convert Clang types to LLVM types for ABI -----==//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// CodeGenABITypes is a simple interface for getting LLVM types for
+// the parameters and the return value of a function given the Clang
+// types.
+//
+// The class is implemented as a public wrapper around the private
+// CodeGenTypes class in lib/CodeGen.
+//
+// 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 actual ABI locations (e.g. registers, stack locations, etc.) that
+// these parameters are stored in.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_CODEGEN_CODEGENABITYPES_H
+#define LLVM_CLANG_CODEGEN_CODEGENABITYPES_H
+
+#include "clang/AST/CanonicalType.h"
+#include "clang/AST/Type.h"
+#include "clang/CodeGen/CGFunctionInfo.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 PreprocessorOptions;
+
+namespace CodeGen {
+class CGFunctionInfo;
+class CodeGenModule;
+
+const CGFunctionInfo &arrangeObjCMessageSendSignature(CodeGenModule &CGM,
+ const ObjCMethodDecl *MD,
+ QualType receiverType);
+
+const CGFunctionInfo &arrangeFreeFunctionType(CodeGenModule &CGM,
+ CanQual<FunctionProtoType> Ty);
+
+const CGFunctionInfo &arrangeFreeFunctionType(CodeGenModule &CGM,
+ CanQual<FunctionNoProtoType> Ty);
+
+const CGFunctionInfo &arrangeCXXMethodType(CodeGenModule &CGM,
+ const CXXRecordDecl *RD,
+ const FunctionProtoType *FTP,
+ const CXXMethodDecl *MD);
+
+const CGFunctionInfo &arrangeFreeFunctionCall(CodeGenModule &CGM,
+ CanQualType returnType,
+ ArrayRef<CanQualType> argTypes,
+ FunctionType::ExtInfo info,
+ RequiredArgs args);
+
+/// Returns null if the function type is incomplete and can't be lowered.
+llvm::FunctionType *convertFreeFunctionType(CodeGenModule &CGM,
+ const FunctionDecl *FD);
+
+llvm::Type *convertTypeForMemory(CodeGenModule &CGM, QualType T);
+
+/// Given a non-bitfield struct field, return its index within the elements of
+/// the struct's converted type. The returned index refers to a field number in
+/// the complete object type which is returned by convertTypeForMemory. FD must
+/// be a field in RD directly (i.e. not an inherited field).
+unsigned getLLVMFieldNumber(CodeGenModule &CGM,
+ const RecordDecl *RD, const FieldDecl *FD);
+
+} // end namespace CodeGen
+} // end namespace clang
+
+#endif