Remove uninformative error message details on division by zero.
Android does not support operator<< for long long. Instead of trying to use a
supported type, we noticed that this error adds very little value so remove it
wholesale.
Change-Id: Id0c15a24f7a609bb6e61a4d0b9816eec80ffc1cf
Reviewed-on: https://swiftshader-review.googlesource.com/2669
Reviewed-by: Greg Hartman <ghartman@google.com>
Tested-by: Greg Hartman <ghartman@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
diff --git a/src/OpenGL/compiler/preprocessor/ExpressionParser.cpp b/src/OpenGL/compiler/preprocessor/ExpressionParser.cpp
index a04ca38..bd22430 100644
--- a/src/OpenGL/compiler/preprocessor/ExpressionParser.cpp
+++ b/src/OpenGL/compiler/preprocessor/ExpressionParser.cpp
@@ -470,7 +470,7 @@
{
0, 85, 85, 92, 93, 96, 99, 102, 105, 108,
111, 114, 117, 120, 123, 126, 129, 132, 135, 138,
- 151, 164, 167, 170, 173, 176, 179
+ 147, 156, 159, 162, 165, 168, 171
};
#endif
@@ -1543,12 +1543,8 @@
{
if ((yyvsp[(3) - (3)]) == 0) {
- std::ostringstream stream;
- stream << (yyvsp[(1) - (3)]) << " % " << (yyvsp[(3) - (3)]);
- std::string text = stream.str();
context->diagnostics->report(pp::Diagnostics::DIVISION_BY_ZERO,
- context->token->location,
- text.c_str());
+ context->token->location, "");
YYABORT;
} else {
(yyval) = (yyvsp[(1) - (3)]) % (yyvsp[(3) - (3)]);
@@ -1560,12 +1556,8 @@
{
if ((yyvsp[(3) - (3)]) == 0) {
- std::ostringstream stream;
- stream << (yyvsp[(1) - (3)]) << " / " << (yyvsp[(3) - (3)]);
- std::string text = stream.str();
context->diagnostics->report(pp::Diagnostics::DIVISION_BY_ZERO,
- context->token->location,
- text.c_str());
+ context->token->location, "");
YYABORT;
} else {
(yyval) = (yyvsp[(1) - (3)]) / (yyvsp[(3) - (3)]);
diff --git a/src/OpenGL/compiler/preprocessor/ExpressionParser.y b/src/OpenGL/compiler/preprocessor/ExpressionParser.y
index 832ad40..b4fb002 100644
--- a/src/OpenGL/compiler/preprocessor/ExpressionParser.y
+++ b/src/OpenGL/compiler/preprocessor/ExpressionParser.y
@@ -137,12 +137,8 @@
}
| expression '%' expression {
if ($3 == 0) {
- std::ostringstream stream;
- stream << $1 << " % " << $3;
- std::string text = stream.str();
context->diagnostics->report(pp::Diagnostics::DIVISION_BY_ZERO,
- context->token->location,
- text.c_str());
+ context->token->location, "");
YYABORT;
} else {
$$ = $1 % $3;
@@ -150,12 +146,8 @@
}
| expression '/' expression {
if ($3 == 0) {
- std::ostringstream stream;
- stream << $1 << " / " << $3;
- std::string text = stream.str();
context->diagnostics->report(pp::Diagnostics::DIVISION_BY_ZERO,
- context->token->location,
- text.c_str());
+ context->token->location, "");
YYABORT;
} else {
$$ = $1 / $3;
diff --git a/src/OpenGL/compiler/preprocessor/Tokenizer.cpp b/src/OpenGL/compiler/preprocessor/Tokenizer.cpp
index 3749ba5..934ca50 100644
--- a/src/OpenGL/compiler/preprocessor/Tokenizer.cpp
+++ b/src/OpenGL/compiler/preprocessor/Tokenizer.cpp
@@ -1,4 +1,4 @@
-#line 16 "./preprocessor/Tokenizer.l"
+#line 16 "./Tokenizer.l"
//
// Copyright (c) 2011-2013 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
@@ -9,7 +9,7 @@
-#line 13 "./preprocessor/Tokenizer.cpp"
+#line 13 "./Tokenizer.cpp"
#define YY_INT_ALIGNED short int