[cfe-commits] r49773 - in /cfe/trunk: include/clang/AST/Expr.h include/clang/Basic/IdentifierTable.h lib/AST/StmtDumper.cpp lib/AST/StmtPrinter.cpp
Ted Kremenek
kremenek at apple.com
Tue Apr 15 21:30:17 PDT 2008
Author: kremenek
Date: Tue Apr 15 23:30:16 2008
New Revision: 49773
URL: http://llvm.org/viewvc/llvm-project?rev=49773&view=rev
Log:
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).
Modified:
cfe/trunk/include/clang/AST/Expr.h
cfe/trunk/include/clang/Basic/IdentifierTable.h
cfe/trunk/lib/AST/StmtDumper.cpp
cfe/trunk/lib/AST/StmtPrinter.cpp
Modified: cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=49773&r1=49772&r2=49773&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Tue Apr 15 23:30:16 2008
@@ -1393,8 +1393,7 @@
: Expr(ObjCSelectorExprClass, T), SelName(selInfo),
AtLoc(at), RParenLoc(rp) {}
- const Selector &getSelector() const { return SelName; }
- Selector &getSelector() { return SelName; }
+ Selector getSelector() const { return SelName; }
SourceLocation getAtLoc() const { return AtLoc; }
SourceLocation getRParenLoc() const { return RParenLoc; }
@@ -1518,7 +1517,6 @@
Expr *getReceiver() { return SubExprs[RECEIVER]; }
Selector getSelector() const { return SelName; }
- Selector &getSelector() { return SelName; }
const ObjCMethodDecl *getMethodDecl() const { return MethodProto; }
ObjCMethodDecl *getMethodDecl() { return MethodProto; }
Modified: cfe/trunk/include/clang/Basic/IdentifierTable.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/IdentifierTable.h?rev=49773&r1=49772&r2=49773&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/IdentifierTable.h (original)
+++ cfe/trunk/include/clang/Basic/IdentifierTable.h Tue Apr 15 23:30:16 2008
@@ -231,10 +231,10 @@
return InfoPtr & ArgFlags;
}
/// operator==/!= - Indicate whether the specified selectors are identical.
- bool operator==(const Selector &RHS) const {
+ bool operator==(Selector RHS) const {
return InfoPtr == RHS.InfoPtr;
}
- bool operator!=(const Selector &RHS) const {
+ bool operator!=(Selector RHS) const {
return InfoPtr != RHS.InfoPtr;
}
void *getAsOpaquePtr() const {
Modified: cfe/trunk/lib/AST/StmtDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtDumper.cpp?rev=49773&r1=49772&r2=49773&view=diff
==============================================================================
--- cfe/trunk/lib/AST/StmtDumper.cpp (original)
+++ cfe/trunk/lib/AST/StmtDumper.cpp Tue Apr 15 23:30:16 2008
@@ -441,7 +441,7 @@
DumpExpr(Node);
fprintf(F, " ");
- Selector &selector = Node->getSelector();
+ Selector selector = Node->getSelector();
fprintf(F, "%s", selector.getName().c_str());
}
Modified: cfe/trunk/lib/AST/StmtPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtPrinter.cpp?rev=49773&r1=49772&r2=49773&view=diff
==============================================================================
--- cfe/trunk/lib/AST/StmtPrinter.cpp (original)
+++ cfe/trunk/lib/AST/StmtPrinter.cpp Tue Apr 15 23:30:16 2008
@@ -822,7 +822,7 @@
Expr *receiver = Mess->getReceiver();
if (receiver) PrintExpr(receiver);
else OS << Mess->getClassName()->getName();
- Selector &selector = Mess->getSelector();
+ Selector selector = Mess->getSelector();
if (selector.isUnarySelector()) {
OS << " " << selector.getIdentifierInfoForSlot(0)->getName();
} else {
More information about the cfe-commits
mailing list