diff options
| author | Reid Kleckner <reid@kleckner.net> | 2013-05-09 21:01:17 +0000 |
|---|---|---|
| committer | Reid Kleckner <reid@kleckner.net> | 2013-05-09 21:01:17 +0000 |
| commit | 452abac4b344742c94703c1165dc0f51caeff8e3 (patch) | |
| tree | 018e2872760236d164959a5968bb51a8ac3fd499 /clang/lib/CodeGen/CGCXXABI.h | |
| parent | f03b2e8385b476546c2f5f54fe3685cd36605e6e (diff) | |
| download | bcm5719-llvm-452abac4b344742c94703c1165dc0f51caeff8e3.tar.gz bcm5719-llvm-452abac4b344742c94703c1165dc0f51caeff8e3.zip | |
[ms-cxxabi] Implement member pointer conversions
Summary:
This only supports converting along non-virtual inheritance paths by
changing the field offset or the non-virtual base adjustment.
This implements three kinds of conversions:
- codegen for Value conversions
- Constant emission for APValue
- Constant folding for CastExprs
In almost all constant initialization settings
EmitMemberPointer(APValue) is called, except when the expression
contains a reinterpret cast.
reinterpret casts end up being a big corner case because the null value
changes between different kinds of member pointers.
Reviewers: rsmith
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D741
llvm-svn: 181543
Diffstat (limited to 'clang/lib/CodeGen/CGCXXABI.h')
| -rw-r--r-- | clang/lib/CodeGen/CGCXXABI.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGCXXABI.h b/clang/lib/CodeGen/CGCXXABI.h index 1e4da631d6f..7f72e1db6e9 100644 --- a/clang/lib/CodeGen/CGCXXABI.h +++ b/clang/lib/CodeGen/CGCXXABI.h @@ -192,6 +192,12 @@ protected: /// is required. llvm::Constant *getMemberPointerAdjustment(const CastExpr *E); + /// \brief Computes the non-virtual adjustment needed for a member pointer + /// conversion along an inheritance path stored in an APValue. Unlike + /// getMemberPointerAdjustment(), the adjustment can be negative if the path + /// is from a derived type to a base type. + CharUnits getMemberPointerPathAdjustment(const APValue &MP); + public: /// Adjust the given non-null pointer to an object of polymorphic /// type to point to the complete object. |

