introduce a new NamedDecl class, switch a couple of things over to using it.
NamedDecl is a Decl that has an IdentifierInfo (for example, ScopedDecl),
but not ObjcMethodDecl.
Simplify some code in ActOnAddMethodsToObjcDecl, by doing the cast from
DeclTy to Decl at the start of the method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42710 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/Decl.cpp b/AST/Decl.cpp
index f046e27..da7aab9 100644
--- a/AST/Decl.cpp
+++ b/AST/Decl.cpp
@@ -214,13 +214,7 @@
Decl::~Decl() {
}
-const char *FieldDecl::getName() const {
- if (const IdentifierInfo *II = getIdentifier())
- return II->getName();
- return "";
-}
-
-const char *ScopedDecl::getName() const {
+const char *NamedDecl::getName() const {
if (const IdentifierInfo *II = getIdentifier())
return II->getName();
return "";