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/preprocessor/DiagnosticsBase.h b/src/compiler/preprocessor/DiagnosticsBase.h
index add6ed3..0c2da1b 100644
--- a/src/compiler/preprocessor/DiagnosticsBase.h
+++ b/src/compiler/preprocessor/DiagnosticsBase.h
@@ -19,11 +19,6 @@
class Diagnostics
{
public:
- enum Severity
- {
- PP_ERROR,
- PP_WARNING
- };
enum ID
{
PP_ERROR_BEGIN,
@@ -83,8 +78,8 @@
void report(ID id, const SourceLocation &loc, const std::string &text);
protected:
- Severity severity(ID id);
- std::string message(ID id);
+ bool isError(ID id);
+ const char *message(ID id);
virtual void print(ID id, const SourceLocation &loc, const std::string &text) = 0;
};