[cfe-commits] r160373 - in /cfe/trunk/lib/CodeGen: CGCXXABI.h CGVTables.cpp ItaniumCXXABI.cpp MicrosoftCXXABI.cpp

John McCall rjmccall at apple.com
Tue Jul 17 11:15:08 PDT 2012


On Jul 17, 2012, at 10:10 AM, Joao Matos wrote:
> Author: triton
> Date: Tue Jul 17 12:10:11 2012
> New Revision: 160373
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=160373&view=rev
> Log:
> [Windows] Abstract pure virtual method calls in the ABI. Fix the Windows ABI to forward to the correct function.
> 
> Modified:
>    cfe/trunk/lib/CodeGen/CGCXXABI.h
>    cfe/trunk/lib/CodeGen/CGVTables.cpp
>    cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp
>    cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp
> 
> Modified: cfe/trunk/lib/CodeGen/CGCXXABI.h
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCXXABI.h?rev=160373&r1=160372&r2=160373&view=diff
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CGCXXABI.h (original)
> +++ cfe/trunk/lib/CodeGen/CGCXXABI.h Tue Jul 17 12:10:11 2012
> @@ -193,6 +193,9 @@
>   virtual void EmitReturnFromThunk(CodeGenFunction &CGF,
>                                    RValue RV, QualType ResultType);
> 
> +  /// Gets the pure virtual member call function.
> +  virtual StringRef GetPureVirtualCallName() = 0;
> +
>   /**************************** Array cookies ******************************/
> 
>   /// Returns the extra size required in order to store the array
> 
> Modified: cfe/trunk/lib/CodeGen/CGVTables.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVTables.cpp?rev=160373&r1=160372&r2=160373&view=diff
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CGVTables.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGVTables.cpp Tue Jul 17 12:10:11 2012
> @@ -569,15 +569,15 @@
> 
>       if (cast<CXXMethodDecl>(GD.getDecl())->isPure()) {
>         // We have a pure virtual member function.
> -        if (!PureVirtualFn) {
> -          llvm::FunctionType *Ty = 
> -            llvm::FunctionType::get(CGM.VoidTy, /*isVarArg=*/false);
> -          PureVirtualFn = 
> -            CGM.CreateRuntimeFunction(Ty, "__cxa_pure_virtual");
> -          PureVirtualFn = llvm::ConstantExpr::getBitCast(PureVirtualFn, 
> -                                                         Int8PtrTy);
> +        if (!PureVirtualFn ) {
> +            llvm::FunctionType *Ty = 
> +                llvm::FunctionType::get(CGM.VoidTy, /*isVarArg=*/false);
> +            StringRef PureCallName = CGM.getCXXABI().GetPureVirtualCallName();
> +            PureVirtualFn = CGM.CreateRuntimeFunction(Ty, PureCallName);
> +            PureVirtualFn = llvm::ConstantExpr::getBitCast(PureVirtualFn,
> +                                                        CGM.Int8PtrTy);
>         }
> -        
> +

Your commit seems to have inappropriately restyled some code.

John.



More information about the cfe-commits mailing list