summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-04-16 04:30:16 +0000
committerTed Kremenek <kremenek@apple.com>2008-04-16 04:30:16 +0000
commitb65a67d7b6fd002fcc861b472bffc273cb786831 (patch)
tree5009228dfce7a2eac5e6f76265bb54738e089d7c /clang
parentbba6a4b3670fd26b97d4a720a495023469c44d59 (diff)
downloadbcm5719-llvm-b65a67d7b6fd002fcc861b472bffc273cb786831.tar.gz
bcm5719-llvm-b65a67d7b6fd002fcc861b472bffc273cb786831.zip
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
Diffstat (limited to 'clang')
-rw-r--r--clang/include/clang/AST/Expr.h4
-rw-r--r--clang/include/clang/Basic/IdentifierTable.h4
-rw-r--r--clang/lib/AST/StmtDumper.cpp2
-rw-r--r--clang/lib/AST/StmtPrinter.cpp2
4 files changed, 5 insertions, 7 deletions
diff --git a/clang/include/clang/AST/Expr.h b/clang/include/clang/AST/Expr.h
index 2cc32a1c4f4..469bf3cbfd4 100644
--- a/clang/include/clang/AST/Expr.h
+++ b/clang/include/clang/AST/Expr.h
@@ -1393,8 +1393,7 @@ public:
: 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 @@ public:
Expr *getReceiver() { return SubExprs[RECEIVER]; }
Selector getSelector() const { return SelName; }
- Selector &getSelector() { return SelName; }
const ObjCMethodDecl *getMethodDecl() const { return MethodProto; }
ObjCMethodDecl *getMethodDecl() { return MethodProto; }
diff --git a/clang/include/clang/Basic/IdentifierTable.h b/clang/include/clang/Basic/IdentifierTable.h
index f64fd6fda4f..7c9efc8bc40 100644
--- a/clang/include/clang/Basic/IdentifierTable.h
+++ b/clang/include/clang/Basic/IdentifierTable.h
@@ -231,10 +231,10 @@ public:
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 {
diff --git a/clang/lib/AST/StmtDumper.cpp b/clang/lib/AST/StmtDumper.cpp
index 2d4adf89387..52eb91e4bf7 100644
--- a/clang/lib/AST/StmtDumper.cpp
+++ b/clang/lib/AST/StmtDumper.cpp
@@ -441,7 +441,7 @@ void StmtDumper::VisitObjCSelectorExpr(ObjCSelectorExpr *Node) {
DumpExpr(Node);
fprintf(F, " ");
- Selector &selector = Node->getSelector();
+ Selector selector = Node->getSelector();
fprintf(F, "%s", selector.getName().c_str());
}
diff --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp
index a76fd1f9b5e..2ff7f79c2de 100644
--- a/clang/lib/AST/StmtPrinter.cpp
+++ b/clang/lib/AST/StmtPrinter.cpp
@@ -822,7 +822,7 @@ void StmtPrinter::VisitObjCMessageExpr(ObjCMessageExpr *Mess) {
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 {
OpenPOWER on IntegriCloud