diff options
author | Douglas Gregor <dgregor@apple.com> | 2008-11-17 14:58:09 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2008-11-17 14:58:09 +0000 |
commit | 2e1cd4264d363ca869bf37ef160902f211d21b8c (patch) | |
tree | b4e6314529ad811be3463a668f8b4e515f66fbcc /lib/AST/StmtDumper.cpp | |
parent | b8abbdc90f902a2c09c566193b900c2c45a46672 (diff) |
Introduction the DeclarationName class, as a single, general method of
representing the names of declarations in the C family of
languages. DeclarationName is used in NamedDecl to store the name of
the declaration (naturally), and ObjCMethodDecl is now a NamedDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59441 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/StmtDumper.cpp')
-rw-r--r-- | lib/AST/StmtDumper.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/AST/StmtDumper.cpp b/lib/AST/StmtDumper.cpp index 0b9e62d2c5..a992efba50 100644 --- a/lib/AST/StmtDumper.cpp +++ b/lib/AST/StmtDumper.cpp @@ -202,7 +202,7 @@ void StmtDumper::DumpDeclarator(Decl *D) { if (TypedefDecl *localType = dyn_cast<TypedefDecl>(D)) { fprintf(F, "\"typedef %s %s\"", localType->getUnderlyingType().getAsString().c_str(), - localType->getName()); + localType->getIdentifierName()); } else if (ValueDecl *VD = dyn_cast<ValueDecl>(D)) { fprintf(F, "\""); // Emit storage class for vardecls. @@ -295,14 +295,16 @@ void StmtDumper::VisitDeclRefExpr(DeclRefExpr *Node) { default: fprintf(F,"Decl"); break; } - fprintf(F, "='%s' %p", Node->getDecl()->getName(), (void*)Node->getDecl()); + fprintf(F, "='%s' %p", Node->getDecl()->getName().c_str(), + (void*)Node->getDecl()); } void StmtDumper::VisitObjCIvarRefExpr(ObjCIvarRefExpr *Node) { DumpExpr(Node); fprintf(F, " %sDecl='%s' %p", Node->getDecl()->getDeclKindName(), - Node->getDecl()->getName(), (void*)Node->getDecl()); + Node->getDecl()->getIdentifierName(), + (void*)Node->getDecl()); if (Node->isFreeIvar()) fprintf(F, " isFreeIvar"); } @@ -373,7 +375,8 @@ void StmtDumper::VisitSizeOfAlignOfExpr(SizeOfAlignOfExpr *Node) { void StmtDumper::VisitMemberExpr(MemberExpr *Node) { DumpExpr(Node); fprintf(F, " %s%s %p", Node->isArrow() ? "->" : ".", - Node->getMemberDecl()->getName(), (void*)Node->getMemberDecl()); + Node->getMemberDecl()->getName().c_str(), + (void*)Node->getMemberDecl()); } void StmtDumper::VisitExtVectorElementExpr(ExtVectorElementExpr *Node) { DumpExpr(Node); @@ -461,7 +464,7 @@ void StmtDumper::VisitObjCProtocolExpr(ObjCProtocolExpr *Node) { DumpExpr(Node); fprintf(F, " "); - fprintf(F, "%s", Node->getProtocol()->getName()); + fprintf(F, "%s", Node->getProtocol()->getIdentifierName()); } void StmtDumper::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *Node) { @@ -474,7 +477,8 @@ void StmtDumper::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *Node) { Getter->getSelector().getName().c_str(), Setter ? Setter->getSelector().getName().c_str() : "(null)"); } else { - fprintf(F, " Kind=PropertyRef Property=\"%s\"", Node->getProperty()->getName()); + fprintf(F, " Kind=PropertyRef Property=\"%s\"", + Node->getProperty()->getIdentifierName()); } } |