[ELF] - Do not report multiple errors for single one in ScriptLexer::setError.

Previously up to 3 errors were reported at once,
with patch we always will report only one,
just like in other linker code.

Differential revision: https://reviews.llvm.org/D37015

llvm-svn: 311537
This commit is contained in:
George Rimar
2017-08-23 08:48:39 +00:00
parent 55f207fb1f
commit de2d1066ae
3 changed files with 13 additions and 17 deletions

View File

@@ -78,15 +78,11 @@ void ScriptLexer::setError(const Twine &Msg) {
if (ErrorCount)
return;
if (!Pos) {
error(getCurrentLocation() + ": " + Msg);
return;
}
std::string S = getCurrentLocation() + ": ";
error(S + Msg);
error(S + getLine());
error(S + std::string(getColumnNumber(), ' ') + "^");
std::string S = (getCurrentLocation() + ": " + Msg).str();
if (Pos)
S += "\n>>> " + getLine().str() + "\n>>> " +
std::string(getColumnNumber(), ' ') + "^";
error(S);
}
// Split S into linker script tokens.