aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/clang/AST/Expr.h4
-rw-r--r--include/clang/Basic/IdentifierTable.h4
-rw-r--r--lib/AST/StmtDumper.cpp2
-rw-r--r--lib/AST/StmtPrinter.cpp2
4 files changed, 5 insertions, 7 deletions
diff --git a/include/clang/AST/Expr.h b/include/clang/AST/Expr.h
index 2cc32a1c4f..469bf3cbfd 100644
--- a/include/clang/AST/Expr.h
+++ b/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/include/clang/Basic/IdentifierTable.h b/include/clang/Basic/IdentifierTable.h
index f64fd6fda4..7c9efc8bc4 100644
--- a/include/clang/Basic/IdentifierTable.h
+++ b/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/lib/AST/StmtDumper.cpp b/lib/AST/StmtDumper.cpp
index 2d4adf8938..52eb91e4bf 100644
--- a/lib/AST/StmtDumper.cpp
+++ b/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/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp
index a76fd1f9b5..2ff7f79c2d 100644
--- a/lib/AST/StmtPrinter.cpp
+++ b/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 {