diff options
author | Andrew Knight <andrew.knight@digia.com> | 2014-02-24 11:18:33 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-26 07:56:50 +0100 |
commit | a7d093e740b1e20874b5ebeb37b5c5d76ae19e42 (patch) | |
tree | 573b63025dbaa090392e468e1a90de8104054578 /src/3rdparty/angle/src/compiler/preprocessor | |
parent | 45e17d0cc74d3444e23c18f73d6ac155659cec55 (diff) |
Upgrade ANGLE to 1.3.5bb7ec572d0a
This brings Qt's copy of ANGLE up to ANGLE master, which contains a number
of bugfixes as well as restructuring for the upcoming ES 3.0 support. This
version brings considerable stability improvements to the D3D11 renderer.
The static translator project files have been merged to align with the
ANGLE source tree.
Two new patches have been applied to fix errors in upstream ANGLE:
- 0011-ANGLE-Fix-compilation-error-on-MinGW-caused-by-trace.patch
The event trace header in ANGLE's third_party directory has an unused
template which causes a compilation error on MinGW. Disable this part
of the code.
- 0012-ANGLE-fix-semantic-index-lookup.patch
The sorted semantic index table was returning a direct mapping to the
new indices, instead of the old indices. This caused a mismatch in the
GL type lookup for the translated attribute.
All other patches have been rebased, removed if no longer needed,
and renamed to clear up the application order:
- 0001-Fix-compilation-for-MSVC-2008-and-std-tuple.patch
No changes.
- 0001-Fix-compilation-with-MinGW-mingw-tdm64-gcc-4.8.1.patch
No changes. Renamed to 0002.
- 0001-Fix-compilation-with-MinGW-gcc-64-bit.patch
No changes. Renamed to 0003.
- 0001-Make-it-possible-to-link-ANGLE-statically-for-single.patch
Modified patch to adapt to new DLL loading structure. Renamed to 0004.
- 0005-Fix-build-when-SSE2-is-not-available.patch
No changes.
- 0011-Fix-compilation-of-libGLESv2-with-older-MinGW-w64-he.patch
No changes. Renamed to 0006.
- 0006-Make-DX9-DX11-mutually-exclusive.patch
Made the patch less invasive by allowing D3D9 code to run unless
explicitly disabled (e.g. on WinRT, where it doesn't compile). This
makes the patch smaller and allows Desktop Windows to compile both
D3D9 and D3D11 codepaths. Renamed to 0007.
- 0015-ANGLE-Dynamically-load-D3D-compiler-from-a-list-of-k.patch
No changes. Renamed to 0008.
- 0012-ANGLE-Support-WinRT.patch
Made D3D11_level9 initialization only possible if D3D9 is disabled.
This makes sure Desktop PCs use the old D3D9 codepath instead of
the less-tested D3D11_level9 codepath. Renamed to 0009.
- 0013-Enable-D3D11-for-feature-level-9-cards.patch
Conveniently smaller patch due to buffer implementation improvements
upstream. Renamed to 0010.
- 0014-ANGLE-D3D11-Alwayls-execute-QueryInterface.patch
This was a fix for patch 0009, so was integrated there. Removed.
- 0016-ANGLE-D3D11-Fix-build-on-desktop-Windows.patch
This was a fix for patch 0009, so it was integrated there. Removed.
- 0001-ANGLE-Fix-compilation-with-MSVC2013.patch
Fixed upstream. Removed.
- 0007-ANGLE-Fix-typedefs-for-Win64.patch
Fixed upstream. Removed.
- 0004-Fix-black-screen-after-minimizing-OpenGL-window-with.patch
The issue has been fixed in Qt itself. Removed.
- 0008-DX11-Prevent-assert-when-view-is-minimized-or-.patch
The cause of the problem was the same as patch 0004, but for the
D3D11 codepath. Removed.
Change-Id: Id69484ab3a3e013050741c462fb1b06dfb0fd112
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Diffstat (limited to 'src/3rdparty/angle/src/compiler/preprocessor')
7 files changed, 143 insertions, 137 deletions
diff --git a/src/3rdparty/angle/src/compiler/preprocessor/DiagnosticsBase.cpp b/src/3rdparty/angle/src/compiler/preprocessor/DiagnosticsBase.cpp index 3e22e1f1c5..a7ce862bcb 100644 --- a/src/3rdparty/angle/src/compiler/preprocessor/DiagnosticsBase.cpp +++ b/src/3rdparty/angle/src/compiler/preprocessor/DiagnosticsBase.cpp @@ -25,14 +25,14 @@ void Diagnostics::report(ID id, Diagnostics::Severity Diagnostics::severity(ID id) { - if ((id > ERROR_BEGIN) && (id < ERROR_END)) - return ERROR; + if ((id > PP_ERROR_BEGIN) && (id < PP_ERROR_END)) + return PP_ERROR; - if ((id > WARNING_BEGIN) && (id < WARNING_END)) - return WARNING; + if ((id > PP_WARNING_BEGIN) && (id < PP_WARNING_END)) + return PP_WARNING; assert(false); - return ERROR; + return PP_ERROR; } std::string Diagnostics::message(ID id) @@ -40,82 +40,82 @@ std::string Diagnostics::message(ID id) switch (id) { // Errors begin. - case INTERNAL_ERROR: + case PP_INTERNAL_ERROR: return "internal error"; - case OUT_OF_MEMORY: + case PP_OUT_OF_MEMORY: return "out of memory"; - case INVALID_CHARACTER: + case PP_INVALID_CHARACTER: return "invalid character"; - case INVALID_NUMBER: + case PP_INVALID_NUMBER: return "invalid number"; - case INTEGER_OVERFLOW: + case PP_INTEGER_OVERFLOW: return "integer overflow"; - case FLOAT_OVERFLOW: + case PP_FLOAT_OVERFLOW: return "float overflow"; - case TOKEN_TOO_LONG: + case PP_TOKEN_TOO_LONG: return "token too long"; - case INVALID_EXPRESSION: + case PP_INVALID_EXPRESSION: return "invalid expression"; - case DIVISION_BY_ZERO: + case PP_DIVISION_BY_ZERO: return "division by zero"; - case EOF_IN_COMMENT: + case PP_EOF_IN_COMMENT: return "unexpected end of file found in comment"; - case UNEXPECTED_TOKEN: + case PP_UNEXPECTED_TOKEN: return "unexpected token"; - case DIRECTIVE_INVALID_NAME: + case PP_DIRECTIVE_INVALID_NAME: return "invalid directive name"; - case MACRO_NAME_RESERVED: + case PP_MACRO_NAME_RESERVED: return "macro name is reserved"; - case MACRO_REDEFINED: + case PP_MACRO_REDEFINED: return "macro redefined"; - case MACRO_PREDEFINED_REDEFINED: + case PP_MACRO_PREDEFINED_REDEFINED: return "predefined macro redefined"; - case MACRO_PREDEFINED_UNDEFINED: + case PP_MACRO_PREDEFINED_UNDEFINED: return "predefined macro undefined"; - case MACRO_UNTERMINATED_INVOCATION: + case PP_MACRO_UNTERMINATED_INVOCATION: return "unterminated macro invocation"; - case MACRO_TOO_FEW_ARGS: + case PP_MACRO_TOO_FEW_ARGS: return "Not enough arguments for macro"; - case MACRO_TOO_MANY_ARGS: + case PP_MACRO_TOO_MANY_ARGS: return "Too many arguments for macro"; - case CONDITIONAL_ENDIF_WITHOUT_IF: + case PP_CONDITIONAL_ENDIF_WITHOUT_IF: return "unexpected #endif found without a matching #if"; - case CONDITIONAL_ELSE_WITHOUT_IF: + case PP_CONDITIONAL_ELSE_WITHOUT_IF: return "unexpected #else found without a matching #if"; - case CONDITIONAL_ELSE_AFTER_ELSE: + case PP_CONDITIONAL_ELSE_AFTER_ELSE: return "unexpected #else found after another #else"; - case CONDITIONAL_ELIF_WITHOUT_IF: + case PP_CONDITIONAL_ELIF_WITHOUT_IF: return "unexpected #elif found without a matching #if"; - case CONDITIONAL_ELIF_AFTER_ELSE: + case PP_CONDITIONAL_ELIF_AFTER_ELSE: return "unexpected #elif found after #else"; - case CONDITIONAL_UNTERMINATED: + case PP_CONDITIONAL_UNTERMINATED: return "unexpected end of file found in conditional block"; - case INVALID_EXTENSION_NAME: + case PP_INVALID_EXTENSION_NAME: return "invalid extension name"; - case INVALID_EXTENSION_BEHAVIOR: + case PP_INVALID_EXTENSION_BEHAVIOR: return "invalid extension behavior"; - case INVALID_EXTENSION_DIRECTIVE: + case PP_INVALID_EXTENSION_DIRECTIVE: return "invalid extension directive"; - case INVALID_VERSION_NUMBER: + case PP_INVALID_VERSION_NUMBER: return "invalid version number"; - case INVALID_VERSION_DIRECTIVE: + case PP_INVALID_VERSION_DIRECTIVE: return "invalid version directive"; - case VERSION_NOT_FIRST_STATEMENT: + case PP_VERSION_NOT_FIRST_STATEMENT: return "#version directive must occur before anything else, " "except for comments and white space"; - case INVALID_LINE_NUMBER: + case PP_INVALID_LINE_NUMBER: return "invalid line number"; - case INVALID_FILE_NUMBER: + case PP_INVALID_FILE_NUMBER: return "invalid file number"; - case INVALID_LINE_DIRECTIVE: + case PP_INVALID_LINE_DIRECTIVE: return "invalid line directive"; // Errors end. // Warnings begin. - case EOF_IN_DIRECTIVE: + case PP_EOF_IN_DIRECTIVE: return "unexpected end of file found in directive"; - case CONDITIONAL_UNEXPECTED_TOKEN: + case PP_CONDITIONAL_UNEXPECTED_TOKEN: return "unexpected token after conditional expression"; - case UNRECOGNIZED_PRAGMA: + case PP_UNRECOGNIZED_PRAGMA: return "unrecognized pragma"; // Warnings end. default: diff --git a/src/3rdparty/angle/src/compiler/preprocessor/DiagnosticsBase.h b/src/3rdparty/angle/src/compiler/preprocessor/DiagnosticsBase.h index 07bc411846..2c8c539137 100644 --- a/src/3rdparty/angle/src/compiler/preprocessor/DiagnosticsBase.h +++ b/src/3rdparty/angle/src/compiler/preprocessor/DiagnosticsBase.h @@ -21,53 +21,53 @@ class Diagnostics public: enum Severity { - ERROR, - WARNING + PP_ERROR, + PP_WARNING }; enum ID { - ERROR_BEGIN, - INTERNAL_ERROR, - OUT_OF_MEMORY, - INVALID_CHARACTER, - INVALID_NUMBER, - INTEGER_OVERFLOW, - FLOAT_OVERFLOW, - TOKEN_TOO_LONG, - INVALID_EXPRESSION, - DIVISION_BY_ZERO, - EOF_IN_COMMENT, - UNEXPECTED_TOKEN, - DIRECTIVE_INVALID_NAME, - MACRO_NAME_RESERVED, - MACRO_REDEFINED, - MACRO_PREDEFINED_REDEFINED, - MACRO_PREDEFINED_UNDEFINED, - MACRO_UNTERMINATED_INVOCATION, - MACRO_TOO_FEW_ARGS, - MACRO_TOO_MANY_ARGS, - CONDITIONAL_ENDIF_WITHOUT_IF, - CONDITIONAL_ELSE_WITHOUT_IF, - CONDITIONAL_ELSE_AFTER_ELSE, - CONDITIONAL_ELIF_WITHOUT_IF, - CONDITIONAL_ELIF_AFTER_ELSE, - CONDITIONAL_UNTERMINATED, - INVALID_EXTENSION_NAME, - INVALID_EXTENSION_BEHAVIOR, - INVALID_EXTENSION_DIRECTIVE, - INVALID_VERSION_NUMBER, - INVALID_VERSION_DIRECTIVE, - VERSION_NOT_FIRST_STATEMENT, - INVALID_LINE_NUMBER, - INVALID_FILE_NUMBER, - INVALID_LINE_DIRECTIVE, - ERROR_END, + PP_ERROR_BEGIN, + PP_INTERNAL_ERROR, + PP_OUT_OF_MEMORY, + PP_INVALID_CHARACTER, + PP_INVALID_NUMBER, + PP_INTEGER_OVERFLOW, + PP_FLOAT_OVERFLOW, + PP_TOKEN_TOO_LONG, + PP_INVALID_EXPRESSION, + PP_DIVISION_BY_ZERO, + PP_EOF_IN_COMMENT, + PP_UNEXPECTED_TOKEN, + PP_DIRECTIVE_INVALID_NAME, + PP_MACRO_NAME_RESERVED, + PP_MACRO_REDEFINED, + PP_MACRO_PREDEFINED_REDEFINED, + PP_MACRO_PREDEFINED_UNDEFINED, + PP_MACRO_UNTERMINATED_INVOCATION, + PP_MACRO_TOO_FEW_ARGS, + PP_MACRO_TOO_MANY_ARGS, + PP_CONDITIONAL_ENDIF_WITHOUT_IF, + PP_CONDITIONAL_ELSE_WITHOUT_IF, + PP_CONDITIONAL_ELSE_AFTER_ELSE, + PP_CONDITIONAL_ELIF_WITHOUT_IF, + PP_CONDITIONAL_ELIF_AFTER_ELSE, + PP_CONDITIONAL_UNTERMINATED, + PP_INVALID_EXTENSION_NAME, + PP_INVALID_EXTENSION_BEHAVIOR, + PP_INVALID_EXTENSION_DIRECTIVE, + PP_INVALID_VERSION_NUMBER, + PP_INVALID_VERSION_DIRECTIVE, + PP_VERSION_NOT_FIRST_STATEMENT, + PP_INVALID_LINE_NUMBER, + PP_INVALID_FILE_NUMBER, + PP_INVALID_LINE_DIRECTIVE, + PP_ERROR_END, - WARNING_BEGIN, - EOF_IN_DIRECTIVE, - CONDITIONAL_UNEXPECTED_TOKEN, - UNRECOGNIZED_PRAGMA, - WARNING_END + PP_WARNING_BEGIN, + PP_EOF_IN_DIRECTIVE, + PP_CONDITIONAL_UNEXPECTED_TOKEN, + PP_UNRECOGNIZED_PRAGMA, + PP_WARNING_END }; virtual ~Diagnostics(); diff --git a/src/3rdparty/angle/src/compiler/preprocessor/DirectiveParser.cpp b/src/3rdparty/angle/src/compiler/preprocessor/DirectiveParser.cpp index 94dfdf513d..ebec79804d 100644 --- a/src/3rdparty/angle/src/compiler/preprocessor/DirectiveParser.cpp +++ b/src/3rdparty/angle/src/compiler/preprocessor/DirectiveParser.cpp @@ -172,7 +172,7 @@ class DefinedParser : public Lexer if (token->type != Token::IDENTIFIER) { - mDiagnostics->report(Diagnostics::UNEXPECTED_TOKEN, + mDiagnostics->report(Diagnostics::PP_UNEXPECTED_TOKEN, token->location, token->text); skipUntilEOD(mLexer, token); return; @@ -185,7 +185,7 @@ class DefinedParser : public Lexer mLexer->lex(token); if (token->type != ')') { - mDiagnostics->report(Diagnostics::UNEXPECTED_TOKEN, + mDiagnostics->report(Diagnostics::PP_UNEXPECTED_TOKEN, token->location, token->text); skipUntilEOD(mLexer, token); return; @@ -233,7 +233,7 @@ void DirectiveParser::lex(Token* token) if (!mConditionalStack.empty()) { const ConditionalBlock& block = mConditionalStack.back(); - mDiagnostics->report(Diagnostics::CONDITIONAL_UNTERMINATED, + mDiagnostics->report(Diagnostics::PP_CONDITIONAL_UNTERMINATED, block.location, block.type); } break; @@ -268,7 +268,7 @@ void DirectiveParser::parseDirective(Token* token) switch(directive) { case DIRECTIVE_NONE: - mDiagnostics->report(Diagnostics::DIRECTIVE_INVALID_NAME, + mDiagnostics->report(Diagnostics::PP_DIRECTIVE_INVALID_NAME, token->location, token->text); skipUntilEOD(mTokenizer, token); break; @@ -319,7 +319,7 @@ void DirectiveParser::parseDirective(Token* token) skipUntilEOD(mTokenizer, token); if (token->type == Token::LAST) { - mDiagnostics->report(Diagnostics::EOF_IN_DIRECTIVE, + mDiagnostics->report(Diagnostics::PP_EOF_IN_DIRECTIVE, token->location, token->text); } } @@ -331,19 +331,19 @@ void DirectiveParser::parseDefine(Token* token) mTokenizer->lex(token); if (token->type != Token::IDENTIFIER) { - mDiagnostics->report(Diagnostics::UNEXPECTED_TOKEN, + mDiagnostics->report(Diagnostics::PP_UNEXPECTED_TOKEN, token->location, token->text); return; } if (isMacroPredefined(token->text, *mMacroSet)) { - mDiagnostics->report(Diagnostics::MACRO_PREDEFINED_REDEFINED, + mDiagnostics->report(Diagnostics::PP_MACRO_PREDEFINED_REDEFINED, token->location, token->text); return; } if (isMacroNameReserved(token->text)) { - mDiagnostics->report(Diagnostics::MACRO_NAME_RESERVED, + mDiagnostics->report(Diagnostics::PP_MACRO_NAME_RESERVED, token->location, token->text); return; } @@ -368,7 +368,7 @@ void DirectiveParser::parseDefine(Token* token) if (token->type != ')') { - mDiagnostics->report(Diagnostics::UNEXPECTED_TOKEN, + mDiagnostics->report(Diagnostics::PP_UNEXPECTED_TOKEN, token->location, token->text); return; @@ -396,7 +396,7 @@ void DirectiveParser::parseDefine(Token* token) MacroSet::const_iterator iter = mMacroSet->find(macro.name); if (iter != mMacroSet->end() && !macro.equals(iter->second)) { - mDiagnostics->report(Diagnostics::MACRO_REDEFINED, + mDiagnostics->report(Diagnostics::PP_MACRO_REDEFINED, token->location, macro.name); return; @@ -411,7 +411,7 @@ void DirectiveParser::parseUndef(Token* token) mTokenizer->lex(token); if (token->type != Token::IDENTIFIER) { - mDiagnostics->report(Diagnostics::UNEXPECTED_TOKEN, + mDiagnostics->report(Diagnostics::PP_UNEXPECTED_TOKEN, token->location, token->text); return; } @@ -421,7 +421,7 @@ void DirectiveParser::parseUndef(Token* token) { if (iter->second.predefined) { - mDiagnostics->report(Diagnostics::MACRO_PREDEFINED_UNDEFINED, + mDiagnostics->report(Diagnostics::PP_MACRO_PREDEFINED_UNDEFINED, token->location, token->text); } else @@ -457,7 +457,7 @@ void DirectiveParser::parseElse(Token* token) if (mConditionalStack.empty()) { - mDiagnostics->report(Diagnostics::CONDITIONAL_ELSE_WITHOUT_IF, + mDiagnostics->report(Diagnostics::PP_CONDITIONAL_ELSE_WITHOUT_IF, token->location, token->text); skipUntilEOD(mTokenizer, token); return; @@ -472,7 +472,7 @@ void DirectiveParser::parseElse(Token* token) } if (block.foundElseGroup) { - mDiagnostics->report(Diagnostics::CONDITIONAL_ELSE_AFTER_ELSE, + mDiagnostics->report(Diagnostics::PP_CONDITIONAL_ELSE_AFTER_ELSE, token->location, token->text); skipUntilEOD(mTokenizer, token); return; @@ -486,7 +486,7 @@ void DirectiveParser::parseElse(Token* token) mTokenizer->lex(token); if (!isEOD(token)) { - mDiagnostics->report(Diagnostics::CONDITIONAL_UNEXPECTED_TOKEN, + mDiagnostics->report(Diagnostics::PP_CONDITIONAL_UNEXPECTED_TOKEN, token->location, token->text); skipUntilEOD(mTokenizer, token); } @@ -498,7 +498,7 @@ void DirectiveParser::parseElif(Token* token) if (mConditionalStack.empty()) { - mDiagnostics->report(Diagnostics::CONDITIONAL_ELIF_WITHOUT_IF, + mDiagnostics->report(Diagnostics::PP_CONDITIONAL_ELIF_WITHOUT_IF, token->location, token->text); skipUntilEOD(mTokenizer, token); return; @@ -513,7 +513,7 @@ void DirectiveParser::parseElif(Token* token) } if (block.foundElseGroup) { - mDiagnostics->report(Diagnostics::CONDITIONAL_ELIF_AFTER_ELSE, + mDiagnostics->report(Diagnostics::PP_CONDITIONAL_ELIF_AFTER_ELSE, token->location, token->text); skipUntilEOD(mTokenizer, token); return; @@ -538,7 +538,7 @@ void DirectiveParser::parseEndif(Token* token) if (mConditionalStack.empty()) { - mDiagnostics->report(Diagnostics::CONDITIONAL_ENDIF_WITHOUT_IF, + mDiagnostics->report(Diagnostics::PP_CONDITIONAL_ENDIF_WITHOUT_IF, token->location, token->text); skipUntilEOD(mTokenizer, token); return; @@ -550,7 +550,7 @@ void DirectiveParser::parseEndif(Token* token) mTokenizer->lex(token); if (!isEOD(token)) { - mDiagnostics->report(Diagnostics::CONDITIONAL_UNEXPECTED_TOKEN, + mDiagnostics->report(Diagnostics::PP_CONDITIONAL_UNEXPECTED_TOKEN, token->location, token->text); skipUntilEOD(mTokenizer, token); } @@ -618,7 +618,7 @@ void DirectiveParser::parsePragma(Token* token) (state == RIGHT_PAREN + 1)); // With value. if (!valid) { - mDiagnostics->report(Diagnostics::UNRECOGNIZED_PRAGMA, + mDiagnostics->report(Diagnostics::PP_UNRECOGNIZED_PRAGMA, token->location, name); } else if (state > PRAGMA_NAME) // Do not notify for empty pragma. @@ -650,7 +650,7 @@ void DirectiveParser::parseExtension(Token* token) case EXT_NAME: if (valid && (token->type != Token::IDENTIFIER)) { - mDiagnostics->report(Diagnostics::INVALID_EXTENSION_NAME, + mDiagnostics->report(Diagnostics::PP_INVALID_EXTENSION_NAME, token->location, token->text); valid = false; } @@ -659,7 +659,7 @@ void DirectiveParser::parseExtension(Token* token) case COLON: if (valid && (token->type != ':')) { - mDiagnostics->report(Diagnostics::UNEXPECTED_TOKEN, + mDiagnostics->report(Diagnostics::PP_UNEXPECTED_TOKEN, token->location, token->text); valid = false; } @@ -667,7 +667,7 @@ void DirectiveParser::parseExtension(Token* token) case EXT_BEHAVIOR: if (valid && (token->type != Token::IDENTIFIER)) { - mDiagnostics->report(Diagnostics::INVALID_EXTENSION_BEHAVIOR, + mDiagnostics->report(Diagnostics::PP_INVALID_EXTENSION_BEHAVIOR, token->location, token->text); valid = false; } @@ -676,7 +676,7 @@ void DirectiveParser::parseExtension(Token* token) default: if (valid) { - mDiagnostics->report(Diagnostics::UNEXPECTED_TOKEN, + mDiagnostics->report(Diagnostics::PP_UNEXPECTED_TOKEN, token->location, token->text); valid = false; } @@ -686,7 +686,7 @@ void DirectiveParser::parseExtension(Token* token) } if (valid && (state != EXT_BEHAVIOR + 1)) { - mDiagnostics->report(Diagnostics::INVALID_EXTENSION_DIRECTIVE, + mDiagnostics->report(Diagnostics::PP_INVALID_EXTENSION_DIRECTIVE, token->location, token->text); valid = false; } @@ -700,7 +700,7 @@ void DirectiveParser::parseVersion(Token* token) if (mPastFirstStatement) { - mDiagnostics->report(Diagnostics::VERSION_NOT_FIRST_STATEMENT, + mDiagnostics->report(Diagnostics::PP_VERSION_NOT_FIRST_STATEMENT, token->location, token->text); skipUntilEOD(mTokenizer, token); return; @@ -723,13 +723,13 @@ void DirectiveParser::parseVersion(Token* token) case VERSION_NUMBER: if (valid && (token->type != Token::CONST_INT)) { - mDiagnostics->report(Diagnostics::INVALID_VERSION_NUMBER, + mDiagnostics->report(Diagnostics::PP_INVALID_VERSION_NUMBER, token->location, token->text); valid = false; } if (valid && !token->iValue(&version)) { - mDiagnostics->report(Diagnostics::INTEGER_OVERFLOW, + mDiagnostics->report(Diagnostics::PP_INTEGER_OVERFLOW, token->location, token->text); valid = false; } @@ -737,7 +737,7 @@ void DirectiveParser::parseVersion(Token* token) default: if (valid) { - mDiagnostics->report(Diagnostics::UNEXPECTED_TOKEN, + mDiagnostics->report(Diagnostics::PP_UNEXPECTED_TOKEN, token->location, token->text); valid = false; } @@ -747,7 +747,7 @@ void DirectiveParser::parseVersion(Token* token) } if (valid && (state != VERSION_NUMBER + 1)) { - mDiagnostics->report(Diagnostics::INVALID_VERSION_DIRECTIVE, + mDiagnostics->report(Diagnostics::PP_INVALID_VERSION_DIRECTIVE, token->location, token->text); valid = false; } @@ -778,13 +778,13 @@ void DirectiveParser::parseLine(Token* token) case LINE_NUMBER: if (valid && (token->type != Token::CONST_INT)) { - mDiagnostics->report(Diagnostics::INVALID_LINE_NUMBER, + mDiagnostics->report(Diagnostics::PP_INVALID_LINE_NUMBER, token->location, token->text); valid = false; } if (valid && !token->iValue(&line)) { - mDiagnostics->report(Diagnostics::INTEGER_OVERFLOW, + mDiagnostics->report(Diagnostics::PP_INTEGER_OVERFLOW, token->location, token->text); valid = false; } @@ -792,13 +792,13 @@ void DirectiveParser::parseLine(Token* token) case FILE_NUMBER: if (valid && (token->type != Token::CONST_INT)) { - mDiagnostics->report(Diagnostics::INVALID_FILE_NUMBER, + mDiagnostics->report(Diagnostics::PP_INVALID_FILE_NUMBER, token->location, token->text); valid = false; } if (valid && !token->iValue(&file)) { - mDiagnostics->report(Diagnostics::INTEGER_OVERFLOW, + mDiagnostics->report(Diagnostics::PP_INTEGER_OVERFLOW, token->location, token->text); valid = false; } @@ -806,7 +806,7 @@ void DirectiveParser::parseLine(Token* token) default: if (valid) { - mDiagnostics->report(Diagnostics::UNEXPECTED_TOKEN, + mDiagnostics->report(Diagnostics::PP_UNEXPECTED_TOKEN, token->location, token->text); valid = false; } @@ -817,7 +817,7 @@ void DirectiveParser::parseLine(Token* token) if (valid && (state != FILE_NUMBER) && (state != FILE_NUMBER + 1)) { - mDiagnostics->report(Diagnostics::INVALID_LINE_DIRECTIVE, + mDiagnostics->report(Diagnostics::PP_INVALID_LINE_DIRECTIVE, token->location, token->text); valid = false; } @@ -893,7 +893,7 @@ int DirectiveParser::parseExpressionIf(Token* token) // Warn if there are tokens after #if expression. if (!isEOD(token)) { - mDiagnostics->report(Diagnostics::CONDITIONAL_UNEXPECTED_TOKEN, + mDiagnostics->report(Diagnostics::PP_CONDITIONAL_UNEXPECTED_TOKEN, token->location, token->text); skipUntilEOD(mTokenizer, token); } @@ -909,7 +909,7 @@ int DirectiveParser::parseExpressionIfdef(Token* token) mTokenizer->lex(token); if (token->type != Token::IDENTIFIER) { - mDiagnostics->report(Diagnostics::UNEXPECTED_TOKEN, + mDiagnostics->report(Diagnostics::PP_UNEXPECTED_TOKEN, token->location, token->text); skipUntilEOD(mTokenizer, token); return 0; @@ -922,7 +922,7 @@ int DirectiveParser::parseExpressionIfdef(Token* token) mTokenizer->lex(token); if (!isEOD(token)) { - mDiagnostics->report(Diagnostics::CONDITIONAL_UNEXPECTED_TOKEN, + mDiagnostics->report(Diagnostics::PP_CONDITIONAL_UNEXPECTED_TOKEN, token->location, token->text); skipUntilEOD(mTokenizer, token); } diff --git a/src/3rdparty/angle/src/compiler/preprocessor/ExpressionParser.y b/src/3rdparty/angle/src/compiler/preprocessor/ExpressionParser.y index b6d3143e60..9fa0f0bf80 100644 --- a/src/3rdparty/angle/src/compiler/preprocessor/ExpressionParser.y +++ b/src/3rdparty/angle/src/compiler/preprocessor/ExpressionParser.y @@ -33,6 +33,12 @@ WHICH GENERATES THE GLSL ES preprocessor expression parser. #include "ExpressionParser.h" +#if defined(_MSC_VER) +#include <malloc.h> +#else +#include <stdlib.h> +#endif + #include <cassert> #include <sstream> @@ -146,7 +152,7 @@ expression std::ostringstream stream; stream << $1 << " % " << $3; std::string text = stream.str(); - context->diagnostics->report(pp::Diagnostics::DIVISION_BY_ZERO, + context->diagnostics->report(pp::Diagnostics::PP_DIVISION_BY_ZERO, context->token->location, text.c_str()); YYABORT; @@ -159,7 +165,7 @@ expression std::ostringstream stream; stream << $1 << " / " << $3; std::string text = stream.str(); - context->diagnostics->report(pp::Diagnostics::DIVISION_BY_ZERO, + context->diagnostics->report(pp::Diagnostics::PP_DIVISION_BY_ZERO, context->token->location, text.c_str()); YYABORT; @@ -201,7 +207,7 @@ int yylex(YYSTYPE* lvalp, Context* context) unsigned int val = 0; if (!token->uValue(&val)) { - context->diagnostics->report(pp::Diagnostics::INTEGER_OVERFLOW, + context->diagnostics->report(pp::Diagnostics::PP_INTEGER_OVERFLOW, token->location, token->text); } *lvalp = static_cast<YYSTYPE>(val); @@ -242,7 +248,7 @@ int yylex(YYSTYPE* lvalp, Context* context) void yyerror(Context* context, const char* reason) { - context->diagnostics->report(pp::Diagnostics::INVALID_EXPRESSION, + context->diagnostics->report(pp::Diagnostics::PP_INVALID_EXPRESSION, context->token->location, reason); } @@ -270,12 +276,12 @@ bool ExpressionParser::parse(Token* token, int* result) break; case 2: - mDiagnostics->report(Diagnostics::OUT_OF_MEMORY, token->location, ""); + mDiagnostics->report(Diagnostics::PP_OUT_OF_MEMORY, token->location, ""); break; default: assert(false); - mDiagnostics->report(Diagnostics::INTERNAL_ERROR, token->location, ""); + mDiagnostics->report(Diagnostics::PP_INTERNAL_ERROR, token->location, ""); break; } diff --git a/src/3rdparty/angle/src/compiler/preprocessor/MacroExpander.cpp b/src/3rdparty/angle/src/compiler/preprocessor/MacroExpander.cpp index 1116c516ff..b789260af9 100644 --- a/src/3rdparty/angle/src/compiler/preprocessor/MacroExpander.cpp +++ b/src/3rdparty/angle/src/compiler/preprocessor/MacroExpander.cpp @@ -254,7 +254,7 @@ bool MacroExpander::collectMacroArgs(const Macro& macro, if (token.type == Token::LAST) { - mDiagnostics->report(Diagnostics::MACRO_UNTERMINATED_INVOCATION, + mDiagnostics->report(Diagnostics::PP_MACRO_UNTERMINATED_INVOCATION, identifier.location, identifier.text); // Do not lose EOF token. ungetToken(token); @@ -302,8 +302,8 @@ bool MacroExpander::collectMacroArgs(const Macro& macro, if (args->size() != params.size()) { Diagnostics::ID id = args->size() < macro.parameters.size() ? - Diagnostics::MACRO_TOO_FEW_ARGS : - Diagnostics::MACRO_TOO_MANY_ARGS; + Diagnostics::PP_MACRO_TOO_FEW_ARGS : + Diagnostics::PP_MACRO_TOO_MANY_ARGS; mDiagnostics->report(id, identifier.location, identifier.text); return false; } diff --git a/src/3rdparty/angle/src/compiler/preprocessor/Preprocessor.cpp b/src/3rdparty/angle/src/compiler/preprocessor/Preprocessor.cpp index b615c85dce..580ffba459 100644 --- a/src/3rdparty/angle/src/compiler/preprocessor/Preprocessor.cpp +++ b/src/3rdparty/angle/src/compiler/preprocessor/Preprocessor.cpp @@ -101,11 +101,11 @@ void Preprocessor::lex(Token* token) assert(false); break; case Token::PP_NUMBER: - mImpl->diagnostics->report(Diagnostics::INVALID_NUMBER, + mImpl->diagnostics->report(Diagnostics::PP_INVALID_NUMBER, token->location, token->text); break; case Token::PP_OTHER: - mImpl->diagnostics->report(Diagnostics::INVALID_CHARACTER, + mImpl->diagnostics->report(Diagnostics::PP_INVALID_CHARACTER, token->location, token->text); break; default: diff --git a/src/3rdparty/angle/src/compiler/preprocessor/Tokenizer.l b/src/3rdparty/angle/src/compiler/preprocessor/Tokenizer.l index 01f0177b6c..f1380b26b7 100644 --- a/src/3rdparty/angle/src/compiler/preprocessor/Tokenizer.l +++ b/src/3rdparty/angle/src/compiler/preprocessor/Tokenizer.l @@ -256,7 +256,7 @@ FRACTIONAL_CONSTANT ({DIGIT}*"."{DIGIT}+)|({DIGIT}+".") if (YY_START == COMMENT) { - yyextra->diagnostics->report(pp::Diagnostics::EOF_IN_COMMENT, + yyextra->diagnostics->report(pp::Diagnostics::PP_EOF_IN_COMMENT, pp::SourceLocation(yyfileno, yylineno), ""); } @@ -304,7 +304,7 @@ void Tokenizer::lex(Token* token) token->type = yylex(&token->text, &token->location, mHandle); if (token->text.size() > mMaxTokenLength) { - mContext.diagnostics->report(Diagnostics::TOKEN_TOO_LONG, + mContext.diagnostics->report(Diagnostics::PP_TOKEN_TOO_LONG, token->location, token->text); token->text.erase(mMaxTokenLength); } |