Unify Diagnostics interface
Use the same kind of interface for reporting preprocessor errors as
for reporting regular compiler errors, and make global errors like
having too many uniforms also go through Diagnostics. Also don't
create std::string objects unnecessarily.
Includes cleanups of some dead code related to reporting errors.
BUG=angleproject:1670
TEST=angle_unittests
Change-Id: I3ee794d32ddeec1826bdf1b76b558f35259f82c0
Reviewed-on: https://chromium-review.googlesource.com/421527
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/compiler/translator/intermOut.cpp b/src/compiler/translator/intermOut.cpp
index 04c3730..31b0fdd 100644
--- a/src/compiler/translator/intermOut.cpp
+++ b/src/compiler/translator/intermOut.cpp
@@ -65,7 +65,7 @@
{
int i;
- sink.location(node->getLine());
+ sink.location(node->getLine().first_file, node->getLine().first_line);
for (i = 0; i < depth; ++i)
sink << " ";
@@ -476,7 +476,7 @@
break;
default:
- out.prefix(EPrefixError);
+ out.prefix(SH_ERROR);
out << "Bad unary op";
}
@@ -512,7 +512,7 @@
if (node->getOp() == EOpNull)
{
- out.prefix(EPrefixError);
+ out.prefix(SH_ERROR);
out << "node is still EOpNull!\n";
return true;
}
@@ -687,7 +687,7 @@
break;
default:
- out.prefix(EPrefixError);
+ out.prefix(SH_ERROR);
out << "Bad aggregation op";
}
@@ -853,7 +853,8 @@
out << " (const uint)\n";
break;
default:
- out.message(EPrefixInternalError, node->getLine(), "Unknown constant");
+ out.prefix(SH_ERROR);
+ out << "Unknown constant";
break;
}
}