Remove uses of "Selector&" and "const Selector&", since Selector is just an

immutable smart pointer (we don't need to pass references, just pass Selector).

llvm-svn: 49773
This commit is contained in:
Ted Kremenek 2008-04-16 04:30:16 +00:00
parent bba6a4b367
commit b65a67d7b6
4 changed files with 5 additions and 7 deletions

View File

@ -1393,8 +1393,7 @@ public:
: Expr(ObjCSelectorExprClass, T), SelName(selInfo), : Expr(ObjCSelectorExprClass, T), SelName(selInfo),
AtLoc(at), RParenLoc(rp) {} AtLoc(at), RParenLoc(rp) {}
const Selector &getSelector() const { return SelName; } Selector getSelector() const { return SelName; }
Selector &getSelector() { return SelName; }
SourceLocation getAtLoc() const { return AtLoc; } SourceLocation getAtLoc() const { return AtLoc; }
SourceLocation getRParenLoc() const { return RParenLoc; } SourceLocation getRParenLoc() const { return RParenLoc; }
@ -1518,7 +1517,6 @@ public:
Expr *getReceiver() { return SubExprs[RECEIVER]; } Expr *getReceiver() { return SubExprs[RECEIVER]; }
Selector getSelector() const { return SelName; } Selector getSelector() const { return SelName; }
Selector &getSelector() { return SelName; }
const ObjCMethodDecl *getMethodDecl() const { return MethodProto; } const ObjCMethodDecl *getMethodDecl() const { return MethodProto; }
ObjCMethodDecl *getMethodDecl() { return MethodProto; } ObjCMethodDecl *getMethodDecl() { return MethodProto; }

View File

@ -231,10 +231,10 @@ public:
return InfoPtr & ArgFlags; return InfoPtr & ArgFlags;
} }
/// operator==/!= - Indicate whether the specified selectors are identical. /// operator==/!= - Indicate whether the specified selectors are identical.
bool operator==(const Selector &RHS) const { bool operator==(Selector RHS) const {
return InfoPtr == RHS.InfoPtr; return InfoPtr == RHS.InfoPtr;
} }
bool operator!=(const Selector &RHS) const { bool operator!=(Selector RHS) const {
return InfoPtr != RHS.InfoPtr; return InfoPtr != RHS.InfoPtr;
} }
void *getAsOpaquePtr() const { void *getAsOpaquePtr() const {

View File

@ -441,7 +441,7 @@ void StmtDumper::VisitObjCSelectorExpr(ObjCSelectorExpr *Node) {
DumpExpr(Node); DumpExpr(Node);
fprintf(F, " "); fprintf(F, " ");
Selector &selector = Node->getSelector(); Selector selector = Node->getSelector();
fprintf(F, "%s", selector.getName().c_str()); fprintf(F, "%s", selector.getName().c_str());
} }

View File

@ -822,7 +822,7 @@ void StmtPrinter::VisitObjCMessageExpr(ObjCMessageExpr *Mess) {
Expr *receiver = Mess->getReceiver(); Expr *receiver = Mess->getReceiver();
if (receiver) PrintExpr(receiver); if (receiver) PrintExpr(receiver);
else OS << Mess->getClassName()->getName(); else OS << Mess->getClassName()->getName();
Selector &selector = Mess->getSelector(); Selector selector = Mess->getSelector();
if (selector.isUnarySelector()) { if (selector.isUnarySelector()) {
OS << " " << selector.getIdentifierInfoForSlot(0)->getName(); OS << " " << selector.getIdentifierInfoForSlot(0)->getName();
} else { } else {