r339264 - [CGObjCGNU] Rename GetSelector helper method to fix -Woverloaded-virtual warning (PR38210)

Hans Wennborg via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 13 04:54:02 PDT 2018


Merged to 7.0 in r339555.

On Wed, Aug 8, 2018 at 5:53 PM, Simon Pilgrim via cfe-commits
<cfe-commits at lists.llvm.org> wrote:
> Author: rksimon
> Date: Wed Aug  8 08:53:14 2018
> New Revision: 339264
>
> URL: http://llvm.org/viewvc/llvm-project?rev=339264&view=rev
> Log:
> [CGObjCGNU] Rename GetSelector helper method to fix -Woverloaded-virtual warning (PR38210)
>
> As suggested by @theraven on PR38210, this patch fixes the gcc -Woverloaded-virtual warnings by renaming the extra CGObjCGNU::GetSelector method to CGObjCGNU::GetTypedSelector
>
> Differential Revision: https://reviews.llvm.org/D50448
>
> Modified:
>     cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
>
> Modified: cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCGNU.cpp?rev=339264&r1=339263&r2=339264&view=diff
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CGObjCGNU.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGObjCGNU.cpp Wed Aug  8 08:53:14 2018
> @@ -510,8 +510,8 @@ protected:
>
>    /// Returns a selector with the specified type encoding.  An empty string is
>    /// used to return an untyped selector (with the types field set to NULL).
> -  virtual llvm::Value *GetSelector(CodeGenFunction &CGF, Selector Sel,
> -                           const std::string &TypeEncoding);
> +  virtual llvm::Value *GetTypedSelector(CodeGenFunction &CGF, Selector Sel,
> +                                        const std::string &TypeEncoding);
>
>    /// Returns the name of ivar offset variables.  In the GNUstep v1 ABI, this
>    /// contains the class and ivar names, in the v2 ABI this contains the type
> @@ -1342,8 +1342,8 @@ class CGObjCGNUstep2 : public CGObjCGNUs
>        return Val;
>      return llvm::ConstantExpr::getBitCast(Val, Ty);
>    }
> -  llvm::Value *GetSelector(CodeGenFunction &CGF, Selector Sel,
> -    const std::string &TypeEncoding) override {
> +  llvm::Value *GetTypedSelector(CodeGenFunction &CGF, Selector Sel,
> +                                const std::string &TypeEncoding) override {
>      return GetConstantSelector(Sel, TypeEncoding);
>    }
>    llvm::Constant  *GetTypeString(llvm::StringRef TypeEncoding) {
> @@ -2121,8 +2121,8 @@ llvm::Value *CGObjCGNU::EmitNSAutoreleas
>    return Value;
>  }
>
> -llvm::Value *CGObjCGNU::GetSelector(CodeGenFunction &CGF, Selector Sel,
> -                                    const std::string &TypeEncoding) {
> +llvm::Value *CGObjCGNU::GetTypedSelector(CodeGenFunction &CGF, Selector Sel,
> +                                         const std::string &TypeEncoding) {
>    SmallVectorImpl<TypedSelector> &Types = SelectorTable[Sel];
>    llvm::GlobalAlias *SelValue = nullptr;
>
> @@ -2155,13 +2155,13 @@ Address CGObjCGNU::GetAddrOfSelector(Cod
>  }
>
>  llvm::Value *CGObjCGNU::GetSelector(CodeGenFunction &CGF, Selector Sel) {
> -  return GetSelector(CGF, Sel, std::string());
> +  return GetTypedSelector(CGF, Sel, std::string());
>  }
>
>  llvm::Value *CGObjCGNU::GetSelector(CodeGenFunction &CGF,
>                                      const ObjCMethodDecl *Method) {
>    std::string SelTypes = CGM.getContext().getObjCEncodingForMethodDecl(Method);
> -  return GetSelector(CGF, Method->getSelector(), SelTypes);
> +  return GetTypedSelector(CGF, Method->getSelector(), SelTypes);
>  }
>
>  llvm::Constant *CGObjCGNU::GetEHType(QualType T) {
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


More information about the cfe-commits mailing list