r210404 - DeclObjC: Fix comments about bad API
Alp Toker
alp at nuanti.com
Sat Jun 7 16:52:23 PDT 2014
What's up with this hiding? It makes the ObjC sema generally difficult
to hack on. Could we rename these not to shadow, or otherwise set the
base values as appropriate?
Alp.
On 08/06/2014 02:31, Alp Toker wrote:
> Author: alp
> Date: Sat Jun 7 18:31:01 2014
> New Revision: 210404
>
> URL: http://llvm.org/viewvc/llvm-project?rev=210404&view=rev
> Log:
> DeclObjC: Fix comments about bad API
>
> What's going on here isn't overriding but rather the sketchy practice of member
> hiding (shadowing of base members).
>
> Modified:
> cfe/trunk/include/clang/AST/DeclObjC.h
>
> Modified: cfe/trunk/include/clang/AST/DeclObjC.h
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclObjC.h?rev=210404&r1=210403&r2=210404&view=diff
> ==============================================================================
> --- cfe/trunk/include/clang/AST/DeclObjC.h (original)
> +++ cfe/trunk/include/clang/AST/DeclObjC.h Sat Jun 7 18:31:01 2014
> @@ -1927,8 +1927,8 @@ public:
>
> /// getIdentifier - Get the identifier that names the category
> /// interface associated with this implementation.
> - /// FIXME: This is a bad API, we are overriding the NamedDecl::getIdentifier()
> - /// to mean something different. For example:
> + /// FIXME: This is a bad API, we are hiding NamedDecl::getIdentifier()
> + /// with a different meaning. For example:
> /// ((NamedDecl *)SomeCategoryImplDecl)->getIdentifier()
> /// returns the class interface name, whereas
> /// ((ObjCCategoryImplDecl *)SomeCategoryImplDecl)->getIdentifier()
> @@ -1945,8 +1945,8 @@ public:
> /// getName - Get the name of identifier for the class interface associated
> /// with this implementation as a StringRef.
> //
> - // FIXME: This is a bad API, we are overriding the NamedDecl::getName, to mean
> - // something different.
> + // FIXME: This is a bad API, we are hiding NamedDecl::getName with a different
> + // meaning.
> StringRef getName() const { return Id ? Id->getName() : StringRef(); }
>
> /// @brief Get the name of the class associated with this interface.
> @@ -2087,8 +2087,8 @@ public:
> /// getName - Get the name of identifier for the class interface associated
> /// with this implementation as a StringRef.
> //
> - // FIXME: This is a bad API, we are overriding the NamedDecl::getName, to mean
> - // something different.
> + // FIXME: This is a bad API, we are hiding NamedDecl::getName with a different
> + // meaning.
> StringRef getName() const {
> assert(getIdentifier() && "Name is not a simple identifier");
> return getIdentifier()->getName();
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
--
http://www.nuanti.com
the browser experts
More information about the cfe-commits
mailing list