]> granicus.if.org Git - clang/commitdiff
Add ObjCCategoryImplDecl::getName() -> StringRef, and a FIXME.
authorDaniel Dunbar <daniel@zuster.org>
Sun, 18 Oct 2009 20:25:46 +0000 (20:25 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Sun, 18 Oct 2009 20:25:46 +0000 (20:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84435 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/DeclObjC.h

index f546e4cd27c6ba011049b8e987529ff3aa148153..d9bac0cff724a8d3da141f256562d179c9eab8e3 100644 (file)
@@ -944,20 +944,29 @@ public:
 
   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;}