summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-rc/ResourceScriptParser.h
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-10-09 18:50:29 +0000
committerZachary Turner <zturner@google.com>2017-10-09 18:50:29 +0000
commit514b7105b52fb98939f2b982651ec876582250f4 (patch)
tree82c677faaf33dd0040f4534c4f9b51145469b7d8 /llvm/tools/llvm-rc/ResourceScriptParser.h
parent4f5a3d5d6f15d8624cd78b53246d633ca54619c1 (diff)
downloadbcm5719-llvm-514b7105b52fb98939f2b982651ec876582250f4.tar.gz
bcm5719-llvm-514b7105b52fb98939f2b982651ec876582250f4.zip
Fix some C++ value / reference semantics issues.
Some functions were taking Twine's not by const&, these are all fixed to take by const&. We also had a case where some functions were overloaded to accept by const& and &&. Now there is only one version which accepts by value and move's the value. llvm-svn: 315229
Diffstat (limited to 'llvm/tools/llvm-rc/ResourceScriptParser.h')
-rw-r--r--llvm/tools/llvm-rc/ResourceScriptParser.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/tools/llvm-rc/ResourceScriptParser.h b/llvm/tools/llvm-rc/ResourceScriptParser.h
index f2afe6d7c32..1a124d4ee2e 100644
--- a/llvm/tools/llvm-rc/ResourceScriptParser.h
+++ b/llvm/tools/llvm-rc/ResourceScriptParser.h
@@ -36,7 +36,7 @@ public:
// Class describing a single failure of parser.
class ParserError : public ErrorInfo<ParserError> {
public:
- ParserError(Twine Expected, const LocIter CurLoc, const LocIter End);
+ ParserError(const Twine &Expected, const LocIter CurLoc, const LocIter End);
void log(raw_ostream &OS) const override { OS << CurMessage; }
std::error_code convertToErrorCode() const override {
@@ -51,8 +51,7 @@ public:
LocIter ErrorLoc, FileEnd;
};
- RCParser(const std::vector<RCToken> &TokenList);
- RCParser(std::vector<RCToken> &&TokenList);
+ RCParser(std::vector<RCToken> TokenList);
// Reads and returns a single resource definition, or error message if any
// occurred.
@@ -172,7 +171,7 @@ private:
// the token that couldn't be parsed. If the flag is on, this complains about
// the correctly read token that makes no sense (that is, the current parser
// state is beyond the erroneous token.)
- Error getExpectedError(const Twine Message, bool IsAlreadyRead = false);
+ Error getExpectedError(const Twine &Message, bool IsAlreadyRead = false);
std::vector<RCToken> Tokens;
LocIter CurLoc;
OpenPOWER on IntegriCloud