summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/StmtDumper.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-24 03:54:41 +0000
committerChris Lattner <sabre@nondot.org>2008-11-24 03:54:41 +0000
commit86d7d91366f5c8f7ae17521abf630ddfd9b4d40e (patch)
tree494e321a9219e5206a02ad7d87a699de983deb9e /clang/lib/AST/StmtDumper.cpp
parent9b1f2792baefb5192373e4c6260a3d437086cf2e (diff)
downloadbcm5719-llvm-86d7d91366f5c8f7ae17521abf630ddfd9b4d40e.tar.gz
bcm5719-llvm-86d7d91366f5c8f7ae17521abf630ddfd9b4d40e.zip
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
Diffstat (limited to 'clang/lib/AST/StmtDumper.cpp')
-rw-r--r--clang/lib/AST/StmtDumper.cpp9
1 files changed, 4 insertions, 5 deletions
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<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) {
OpenPOWER on IntegriCloud