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).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49773 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/AST/Expr.h b/include/clang/AST/Expr.h
index 2cc32a1..469bf3c 100644
--- a/include/clang/AST/Expr.h
+++ b/include/clang/AST/Expr.h
@@ -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; }
diff --git a/include/clang/Basic/IdentifierTable.h b/include/clang/Basic/IdentifierTable.h
index f64fd6f..7c9efc8 100644
--- a/include/clang/Basic/IdentifierTable.h
+++ b/include/clang/Basic/IdentifierTable.h
@@ -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 {
diff --git a/lib/AST/StmtDumper.cpp b/lib/AST/StmtDumper.cpp
index 2d4adf8..52eb91e 100644
--- a/lib/AST/StmtDumper.cpp
+++ b/lib/AST/StmtDumper.cpp
@@ -441,7 +441,7 @@
DumpExpr(Node);
fprintf(F, " ");
- Selector &selector = Node->getSelector();
+ Selector selector = Node->getSelector();
fprintf(F, "%s", selector.getName().c_str());
}
diff --git a/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp
index a76fd1f..2ff7f79 100644
--- a/lib/AST/StmtPrinter.cpp
+++ b/lib/AST/StmtPrinter.cpp
@@ -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 {