Skip to content
Snippets Groups Projects
Commit fdcbc331 authored by Daniel Dunbar's avatar Daniel Dunbar
Browse files

Add ObjCImplementationDecl::getName() for consistency, with FIXME.

llvm-svn: 84455
parent 8b794813
No related branches found
No related tags found
No related merge requests found
...@@ -1008,21 +1008,30 @@ public: ...@@ -1008,21 +1008,30 @@ public:
return getClassInterface()->getIdentifier(); 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 /// getNameAsCString - Get the name of identifier for the class
/// interface associated with this implementation as a C string /// interface associated with this implementation as a C string
/// (const char*). /// (const char*).
// //
// FIXME: Move to StringRef API. // FIXME: Move to StringRef API.
const char *getNameAsCString() const { const char *getNameAsCString() const {
assert(getIdentifier() && "Name is not a simple identifier"); return getName().data();
return getIdentifier()->getNameStart();
} }
/// @brief Get the name of the class associated with this interface. /// @brief Get the name of the class associated with this interface.
// //
// FIXME: Move to StringRef API. // FIXME: Move to StringRef API.
std::string getNameAsString() const { std::string getNameAsString() const {
return getClassInterface()->getNameAsString(); return getName();
} }
const ObjCInterfaceDecl *getSuperClass() const { return SuperClass; } const ObjCInterfaceDecl *getSuperClass() const { return SuperClass; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment