diff options
author | dim <dim@FreeBSD.org> | 2013-12-22 00:07:40 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-12-22 00:07:40 +0000 |
commit | 952eddef9aff85b1e92626e89baaf7a360e2ac85 (patch) | |
tree | df8df0b0067b381eab470a3b8f28d14a552a6340 /lib/CodeGen/CodeGenABITypes.cpp | |
parent | ea266cad53e3d49771fa38103913d3ec7a166694 (diff) | |
download | FreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.zip FreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.tar.gz |
Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3):
https://llvm.org/svn/llvm-project/cfe/branches/release_34@197841
Diffstat (limited to 'lib/CodeGen/CodeGenABITypes.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenABITypes.cpp | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/lib/CodeGen/CodeGenABITypes.cpp b/lib/CodeGen/CodeGenABITypes.cpp new file mode 100644 index 0000000..18c836c --- /dev/null +++ b/lib/CodeGen/CodeGenABITypes.cpp @@ -0,0 +1,69 @@ +//==--- CodeGenABITypes.cpp - Convert Clang types to LLVM types for ABI ----==// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +#include "clang/CodeGen/CodeGenABITypes.h" + +#include "clang/CodeGen/CGFunctionInfo.h" +#include "CodeGenModule.h" + +using namespace clang; +using namespace CodeGen; + +CodeGenABITypes::CodeGenABITypes(ASTContext &C, + const CodeGenOptions &CodeGenOpts, + llvm::Module &M, + const llvm::DataLayout &TD, + DiagnosticsEngine &Diags) + : CGM(new CodeGen::CodeGenModule(C, CodeGenOpts, M, TD, Diags)) { +} + +CodeGenABITypes::~CodeGenABITypes() +{ + delete CGM; +} + +const CGFunctionInfo & +CodeGenABITypes::arrangeObjCMessageSendSignature(const ObjCMethodDecl *MD, + QualType receiverType) { + return CGM->getTypes().arrangeObjCMessageSendSignature(MD, receiverType); +} + +const CGFunctionInfo & +CodeGenABITypes::arrangeFreeFunctionType(CanQual<FunctionProtoType> Ty) { + return CGM->getTypes().arrangeFreeFunctionType(Ty); +} + +const CGFunctionInfo & +CodeGenABITypes::arrangeFreeFunctionType(CanQual<FunctionNoProtoType> Ty) { + return CGM->getTypes().arrangeFreeFunctionType(Ty); +} + +const CGFunctionInfo & +CodeGenABITypes::arrangeCXXMethodType(const CXXRecordDecl *RD, + const FunctionProtoType *FTP) { + return CGM->getTypes().arrangeCXXMethodType(RD, FTP); +} + +const CGFunctionInfo & +CodeGenABITypes::arrangeLLVMFunctionInfo(CanQualType returnType, + llvm::ArrayRef<CanQualType> argTypes, + FunctionType::ExtInfo info, + RequiredArgs args) { + return CGM->getTypes().arrangeLLVMFunctionInfo(returnType, argTypes, + info, args); +} |