summaryrefslogtreecommitdiffstats
path: root/clang/AST/Decl.cpp
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2007-09-13 21:41:19 +0000
committerSteve Naroff <snaroff@apple.com>2007-09-13 21:41:19 +0000
commit9def2b15c1193ee423ffe11125154bd86dd71a1d (patch)
tree8c006647b8f389d9246fccf212784c3cdc84268a /clang/AST/Decl.cpp
parent011f91b5b24cc27071877f3d75f961c187afc5d4 (diff)
downloadbcm5719-llvm-9def2b15c1193ee423ffe11125154bd86dd71a1d.tar.gz
bcm5719-llvm-9def2b15c1193ee423ffe11125154bd86dd71a1d.zip
Phase 2 of making the Decl class more lightweight...
Move Identifier/Loc instance variables (and associated getters/setters) down from Decl to ScopedDecl/FieldDecl. Objc AST's can now inherit from Decl without getting instance variables and types that are C specific. For now, I am keeping NextDeclarator, since I believe it may be useful to ObjC. If not, it can be moved later. llvm-svn: 41934
Diffstat (limited to 'clang/AST/Decl.cpp')
-rw-r--r--clang/AST/Decl.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/AST/Decl.cpp b/clang/AST/Decl.cpp
index e84532923be..4b668c26863 100644
--- a/clang/AST/Decl.cpp
+++ b/clang/AST/Decl.cpp
@@ -112,7 +112,13 @@ void Decl::addDeclKind(const Kind k) {
Decl::~Decl() {
}
-const char *Decl::getName() const {
+const char *FieldDecl::getName() const {
+ if (const IdentifierInfo *II = getIdentifier())
+ return II->getName();
+ return "";
+}
+
+const char *ScopedDecl::getName() const {
if (const IdentifierInfo *II = getIdentifier())
return II->getName();
return "";
OpenPOWER on IntegriCloud