[cfe-commits] r84435 - /cfe/trunk/include/clang/AST/DeclObjC.h

Daniel Dunbar daniel at zuster.org
Sun Oct 18 13:25:47 PDT 2009


Author: ddunbar
Date: Sun Oct 18 15:25:46 2009
New Revision: 84435

URL: http://llvm.org/viewvc/llvm-project?rev=84435&view=rev
Log:
Add ObjCCategoryImplDecl::getName() -> StringRef, and a FIXME.

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=84435&r1=84434&r2=84435&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/DeclObjC.h (original)
+++ cfe/trunk/include/clang/AST/DeclObjC.h Sun Oct 18 15:25:46 2009
@@ -944,20 +944,29 @@
 
   ObjCCategoryDecl *getCategoryClass() const;
 
+  /// 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.
+  llvm::StringRef getName() const {
+    return Id ? Id->getNameStart() : "";
+  }
+
   /// getNameAsCString - Get the name of identifier for the class
   /// interface associated with this implementation as a C string
   /// (const char*).
   //
-  // FIXME: Move to StringRef API.
+  // FIXME: Deprecated, move clients to getName().
   const char *getNameAsCString() const {
     return Id ? Id->getNameStart() : "";
   }
 
   /// @brief Get the name of the class associated with this interface.
   //
-  // FIXME: Move to StringRef API.
+  // FIXME: Deprecated, move clients to getName().
   std::string getNameAsString() const {
-    return Id ? Id->getNameStr() : "";
+    return getName();
   }
 
   static bool classof(const Decl *D) { return D->getKind() == ObjCCategoryImpl;}





More information about the cfe-commits mailing list