diff options
author | Yaxun Liu <Yaxun.Liu@amd.com> | 2016-12-15 08:09:08 +0000 |
---|---|---|
committer | Yaxun Liu <Yaxun.Liu@amd.com> | 2016-12-15 08:09:08 +0000 |
commit | 402804b6d67c880c97e575342189025fe28c0f81 (patch) | |
tree | f05c793f67afb7f12b82a43b0926afd04c0ae4ec /clang/lib/CodeGen/TargetInfo.h | |
parent | 61ef150d53e4a9a3f14f614991f8132a5bb4eedc (diff) | |
download | bcm5719-llvm-402804b6d67c880c97e575342189025fe28c0f81.tar.gz bcm5719-llvm-402804b6d67c880c97e575342189025fe28c0f81.zip |
Re-commit r289252 and r289285, and fix PR31374
llvm-svn: 289787
Diffstat (limited to 'clang/lib/CodeGen/TargetInfo.h')
-rw-r--r-- | clang/lib/CodeGen/TargetInfo.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.h b/clang/lib/CodeGen/TargetInfo.h index e46382596af..223d6d047af 100644 --- a/clang/lib/CodeGen/TargetInfo.h +++ b/clang/lib/CodeGen/TargetInfo.h @@ -220,6 +220,22 @@ public: /// Get LLVM calling convention for OpenCL kernel. virtual unsigned getOpenCLKernelCallingConv() const; + + /// Get target specific null pointer. + /// \param T is the LLVM type of the null pointer. + /// \param QT is the clang QualType of the null pointer. + /// \return ConstantPointerNull with the given type \p T. + /// Each target can override it to return its own desired constant value. + virtual llvm::Constant *getNullPointer(const CodeGen::CodeGenModule &CGM, + llvm::PointerType *T, QualType QT) const; + + /// Perform address space cast of an expression of pointer type. + /// \param V is the LLVM value to be casted to another address space. + /// \param SrcTy is the QualType of \p V. + /// \param DestTy is the destination QualType. + virtual llvm::Value *performAddrSpaceCast(CodeGen::CodeGenFunction &CGF, + llvm::Value *V, QualType SrcTy, QualType DestTy) const; + }; } // namespace CodeGen |