[cfe-commits] r43042 - in /cfe/trunk/AST: StmtDumper.cpp StmtPrinter.cpp
Fariborz Jahanian
fjahanian at apple.com
Tue Oct 16 14:07:53 PDT 2007
Author: fjahanian
Date: Tue Oct 16 16:07:53 2007
New Revision: 43042
URL: http://llvm.org/viewvc/llvm-project?rev=43042&view=rev
Log:
Steve, pointer out that getName() is available for selectors. Made code much smaller, thanks.
Modified:
cfe/trunk/AST/StmtDumper.cpp
cfe/trunk/AST/StmtPrinter.cpp
Modified: cfe/trunk/AST/StmtDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/StmtDumper.cpp?rev=43042&r1=43041&r2=43042&view=diff
==============================================================================
--- cfe/trunk/AST/StmtDumper.cpp (original)
+++ cfe/trunk/AST/StmtDumper.cpp Tue Oct 16 16:07:53 2007
@@ -412,15 +412,7 @@
fprintf(F, " ");
Selector &selector = Node->getSelector();
- if (selector.isUnarySelector())
- fprintf(F, "%s", selector.getIdentifierInfoForSlot(0)->getName());
- else {
- for (unsigned i = 0, e = Node->getNumArgs(); i != e; ++i)
- if (selector.getIdentifierInfoForSlot(i))
- fprintf(F, "%s:", selector.getIdentifierInfoForSlot(i)->getName());
- else
- fprintf(F, ":");
- }
+ fprintf(F, "%s", selector.getName().c_str());
}
//===----------------------------------------------------------------------===//
Modified: cfe/trunk/AST/StmtPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/StmtPrinter.cpp?rev=43042&r1=43041&r2=43042&view=diff
==============================================================================
--- cfe/trunk/AST/StmtPrinter.cpp (original)
+++ cfe/trunk/AST/StmtPrinter.cpp Tue Oct 16 16:07:53 2007
@@ -623,15 +623,7 @@
void StmtPrinter::VisitObjCSelectorExpr(ObjCSelectorExpr *Node) {
OS << "@selector(";
Selector &selector = Node->getSelector();
- if (selector.isUnarySelector())
- OS << " " << selector.getIdentifierInfoForSlot(0)->getName();
- else {
- for (unsigned i = 0, e = Node->getNumArgs(); i != e; ++i)
- if (selector.getIdentifierInfoForSlot(i))
- OS << selector.getIdentifierInfoForSlot(i)->getName() << ":";
- else
- OS << ":";
- }
+ OS << " " << selector.getName();
OS << ")";
}
More information about the cfe-commits
mailing list