diff options
author | John McCall <rjmccall@apple.com> | 2010-08-22 10:59:02 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-08-22 10:59:02 +0000 |
commit | a1dee5300b3a0ad0c6e763d83d528ab0e6fc9c78 (patch) | |
tree | 2bce21ec67c8ff401bc950847fa406094f814865 /clang/lib/CodeGen/CGCXXABI.h | |
parent | 131d97d80923ab4a068ee8a5fc3dbed5c97bd15e (diff) | |
download | bcm5719-llvm-a1dee5300b3a0ad0c6e763d83d528ab0e6fc9c78.tar.gz bcm5719-llvm-a1dee5300b3a0ad0c6e763d83d528ab0e6fc9c78.zip |
Experiment with using first-class aggregates to represent member function
pointers. I find the resulting code to be substantially cleaner, and it
makes it very easy to use the same APIs for data member pointers (which I have
conscientiously avoided here), and it avoids a plethora of potential
inefficiencies due to excessive memory copying, but we'll have to see if it
actually works.
llvm-svn: 111776
Diffstat (limited to 'clang/lib/CodeGen/CGCXXABI.h')
-rw-r--r-- | clang/lib/CodeGen/CGCXXABI.h | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/clang/lib/CodeGen/CGCXXABI.h b/clang/lib/CodeGen/CGCXXABI.h index 8478df48160..d0bb0e864f9 100644 --- a/clang/lib/CodeGen/CGCXXABI.h +++ b/clang/lib/CodeGen/CGCXXABI.h @@ -34,7 +34,13 @@ namespace CodeGen { /// Implements C++ ABI-specific code generation functions. class CGCXXABI { +protected: + CodeGenModule &CGM; + + CGCXXABI(CodeGenModule &CGM) : CGM(CGM) {} + public: + virtual ~CGCXXABI(); /// Gets the mangle context. @@ -46,18 +52,11 @@ public: llvm::Value *MemPtr, const MemberPointerType *MPT); - virtual void + virtual llvm::Value * EmitMemberFunctionPointerConversion(CodeGenFunction &CGF, const CastExpr *E, - llvm::Value *Src, - llvm::Value *Dest, - bool VolatileDest); - - virtual void EmitNullMemberFunctionPointer(CodeGenFunction &CGF, - const MemberPointerType *MPT, - llvm::Value *Dest, - bool VolatileDest); - + llvm::Value *Src); + // Manipulations on constant expressions. /// \brief Returns true if zero-initializing the given type requires @@ -73,10 +72,6 @@ public: EmitNullMemberFunctionPointer(const MemberPointerType *MPT); virtual llvm::Constant *EmitMemberFunctionPointer(const CXXMethodDecl *MD); - virtual void EmitMemberFunctionPointer(CodeGenFunction &CGF, - const CXXMethodDecl *MD, - llvm::Value *DestPtr, - bool VolatileDest); virtual llvm::Value * EmitMemberFunctionPointerComparison(CodeGenFunction &CGF, @@ -87,7 +82,7 @@ public: virtual llvm::Value * EmitMemberFunctionPointerIsNotNull(CodeGenFunction &CGF, - llvm::Value *Addr, + llvm::Value *MemPtr, const MemberPointerType *MPT); }; |