From 86d7d91366f5c8f7ae17521abf630ddfd9b4d40e Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 24 Nov 2008 03:54:41 +0000 Subject: Rename NamedDecl::getIdentifierName() to ::getNameAsCString() and make it assert if the name is not an identifier. Update callers to do the right thing and avoid this method in unsafe cases. This also fixes an objc warning that was missing a space, and migrates a couple more to taking IdentifierInfo and QualTypes instead of std::strings. llvm-svn: 59936 --- clang/lib/AST/StmtDumper.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'clang/lib/AST/StmtDumper.cpp') diff --git a/clang/lib/AST/StmtDumper.cpp b/clang/lib/AST/StmtDumper.cpp index f7330c2a9dc..b73dc534dcf 100644 --- a/clang/lib/AST/StmtDumper.cpp +++ b/clang/lib/AST/StmtDumper.cpp @@ -203,7 +203,7 @@ void StmtDumper::DumpDeclarator(Decl *D) { if (TypedefDecl *localType = dyn_cast(D)) { fprintf(F, "\"typedef %s %s\"", localType->getUnderlyingType().getAsString().c_str(), - localType->getIdentifierName()); + localType->getNameAsString().c_str()); } else if (ValueDecl *VD = dyn_cast(D)) { fprintf(F, "\""); // Emit storage class for vardecls. @@ -304,8 +304,7 @@ void StmtDumper::VisitObjCIvarRefExpr(ObjCIvarRefExpr *Node) { DumpExpr(Node); fprintf(F, " %sDecl='%s' %p", Node->getDecl()->getDeclKindName(), - Node->getDecl()->getIdentifierName(), - (void*)Node->getDecl()); + Node->getDecl()->getNameAsString().c_str(), (void*)Node->getDecl()); if (Node->isFreeIvar()) fprintf(F, " isFreeIvar"); } @@ -464,14 +463,14 @@ void StmtDumper::VisitObjCProtocolExpr(ObjCProtocolExpr *Node) { DumpExpr(Node); fprintf(F, " "); - fprintf(F, "%s", Node->getProtocol()->getIdentifierName()); + fprintf(F, "%s", Node->getProtocol()->getNameAsString().c_str()); } void StmtDumper::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *Node) { DumpExpr(Node); fprintf(F, " Kind=PropertyRef Property=\"%s\"", - Node->getProperty()->getIdentifierName()); + Node->getProperty()->getNameAsString().c_str()); } void StmtDumper::VisitObjCKVCRefExpr(ObjCKVCRefExpr *Node) { -- cgit v1.2.3