diff options
| author | John McCall <rjmccall@apple.com> | 2017-07-12 07:44:17 +0000 |
|---|---|---|
| committer | John McCall <rjmccall@apple.com> | 2017-07-12 07:44:17 +0000 |
| commit | 0a2cde365a8958b8cd4d23f88bc45e9116cfdcc6 (patch) | |
| tree | d0dd7f73714a9f36473216b57618ae24482e463d /clang/lib/CodeGen | |
| parent | 351c218d15720158b1de0fc3b1d552e5e5f3302a (diff) | |
| download | bcm5719-llvm-0a2cde365a8958b8cd4d23f88bc45e9116cfdcc6.tar.gz bcm5719-llvm-0a2cde365a8958b8cd4d23f88bc45e9116cfdcc6.zip | |
Expose some type-conversion functions as part of the IRGen ABI.
Patch by Benoit Vey!
llvm-svn: 307760
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CodeGenABITypes.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenABITypes.cpp b/clang/lib/CodeGen/CodeGenABITypes.cpp index 166f44f816f..0735a9c3dfb 100644 --- a/clang/lib/CodeGen/CodeGenABITypes.cpp +++ b/clang/lib/CodeGen/CodeGenABITypes.cpp @@ -64,3 +64,19 @@ CodeGen::arrangeFreeFunctionCall(CodeGenModule &CGM, returnType, /*IsInstanceMethod=*/false, /*IsChainCall=*/false, argTypes, info, {}, args); } + +llvm::FunctionType * +CodeGen::convertFreeFunctionType(CodeGenModule &CGM, const FunctionDecl *FD) { + assert(FD != nullptr && "Expected a non-null function declaration!"); + llvm::Type *T = CGM.getTypes().ConvertFunctionType(FD->getType(), FD); + + if (auto FT = dyn_cast<llvm::FunctionType>(T)) + return FT; + + return nullptr; +} + +llvm::Type * +CodeGen::convertTypeForMemory(CodeGenModule &CGM, QualType T) { + return CGM.getTypes().ConvertTypeForMem(T); +} |

