diff options
author | Chris Lattner <sabre@nondot.org> | 2008-11-24 03:54:41 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-11-24 03:54:41 +0000 |
commit | 8ec03f58c33c33a917f54bb7f2cd61b6d7ffe0ca (patch) | |
tree | ab82837deaf7ca40831de4b7467d2d3c1982c9ff /lib/AST/StmtDumper.cpp | |
parent | bb49c3ee5d270485f4b273691fd14bc97403fa5d (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59936 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/StmtDumper.cpp')
-rw-r--r-- | lib/AST/StmtDumper.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/AST/StmtDumper.cpp b/lib/AST/StmtDumper.cpp index f7330c2a9d..b73dc534dc 100644 --- a/lib/AST/StmtDumper.cpp +++ b/lib/AST/StmtDumper.cpp @@ -203,7 +203,7 @@ void StmtDumper::DumpDeclarator(Decl *D) { if (TypedefDecl *localType = dyn_cast<TypedefDecl>(D)) { fprintf(F, "\"typedef %s %s\"", localType->getUnderlyingType().getAsString().c_str(), - localType->getIdentifierName()); + localType->getNameAsString().c_str()); } else if (ValueDecl *VD = dyn_cast<ValueDecl>(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) { |