[lld] r288309 - Do not name a variable Ret which is not a return value.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 30 20:36:51 PST 2016
Author: ruiu
Date: Wed Nov 30 22:36:51 2016
New Revision: 288309
URL: http://llvm.org/viewvc/llvm-project?rev=288309&view=rev
Log:
Do not name a variable Ret which is not a return value.
Modified:
lld/trunk/ELF/ScriptParser.cpp
Modified: lld/trunk/ELF/ScriptParser.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/ScriptParser.cpp?rev=288309&r1=288308&r2=288309&view=diff
==============================================================================
--- lld/trunk/ELF/ScriptParser.cpp (original)
+++ lld/trunk/ELF/ScriptParser.cpp Wed Nov 30 22:36:51 2016
@@ -72,7 +72,7 @@ void ScriptParserBase::setError(const Tw
// Split S into linker script tokens.
void ScriptParserBase::tokenize(MemoryBufferRef MB) {
- std::vector<StringRef> Ret;
+ std::vector<StringRef> Vec;
MBs.push_back(MB);
StringRef S = MB.getBuffer();
StringRef Begin = S;
@@ -91,11 +91,11 @@ void ScriptParserBase::tokenize(MemoryBu
if (E == StringRef::npos) {
StringRef Filename = MB.getBufferIdentifier();
size_t Lineno = Begin.substr(0, S.data() - Begin.data()).count('\n');
- error(Filename + ":" + Twine(Lineno) + ": unclosed quote");
+ error(Filename + ":" + Twine(Lineno + 1) + ": unclosed quote");
return;
}
- Ret.push_back(S.take_front(E + 1));
+ Vec.push_back(S.take_front(E + 1));
S = S.substr(E + 1);
continue;
}
@@ -110,11 +110,11 @@ void ScriptParserBase::tokenize(MemoryBu
// punctuation) forms a single character token.
if (Pos == 0)
Pos = 1;
- Ret.push_back(S.substr(0, Pos));
+ Vec.push_back(S.substr(0, Pos));
S = S.substr(Pos);
}
- Tokens.insert(Tokens.begin() + Pos, Ret.begin(), Ret.end());
+ Tokens.insert(Tokens.begin() + Pos, Vec.begin(), Vec.end());
}
// Skip leading whitespace characters or comments.
More information about the llvm-commits
mailing list