[cfe-commits] r84455 - /cfe/trunk/include/clang/AST/DeclObjC.h
Daniel Dunbar
daniel at zuster.org
Sun Oct 18 18:20:57 PDT 2009
Author: ddunbar
Date: Sun Oct 18 20:20:57 2009
New Revision: 84455
URL: http://llvm.org/viewvc/llvm-project?rev=84455&view=rev
Log:
Add ObjCImplementationDecl::getName() for consistency, with 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=84455&r1=84454&r2=84455&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclObjC.h (original)
+++ cfe/trunk/include/clang/AST/DeclObjC.h Sun Oct 18 20:20:57 2009
@@ -1008,21 +1008,30 @@
return getClassInterface()->getIdentifier();
}
+ /// 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 {
+ assert(getIdentifier() && "Name is not a simple identifier");
+ return getIdentifier()->getName();
+ }
+
/// 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.
const char *getNameAsCString() const {
- assert(getIdentifier() && "Name is not a simple identifier");
- return getIdentifier()->getNameStart();
+ return getName().data();
}
/// @brief Get the name of the class associated with this interface.
//
// FIXME: Move to StringRef API.
std::string getNameAsString() const {
- return getClassInterface()->getNameAsString();
+ return getName();
}
const ObjCInterfaceDecl *getSuperClass() const { return SuperClass; }
More information about the cfe-commits
mailing list