OSDN Git Service

Support parsing defined operator generated by macro expansion
authorNicolas Capens <capn@google.com>
Fri, 22 Apr 2016 15:00:31 +0000 (11:00 -0400)
committerNicolas Capens <capn@google.com>
Fri, 22 Apr 2016 19:04:02 +0000 (19:04 +0000)
commitc36488989e262e72c3808694c3757cc86150f4b6
tree87be7af7ab2df0856446343f7176e7bf6274126d
parentd0e6f6808f4bcb10bb2cd6eb0a47f5c070dafa4c
Support parsing defined operator generated by macro expansion

dEQP tests enforce that the defined operator should be parsed even when
it is generated as a result of macro expansion, even though this is
undefined according to the C++ preprocessor spec.

Implement support for this by putting the parsing for the defined
operator inside MacroExpander. The operator gets processed right after
it is generated by macro expansion. Parsing the defined operator is
toggled with a boolean according to the context where MacroExpander
is used.

Change-Id: I8557e829f4278ab6cb27eb4a0f84ca0c0dd18d1a
Reviewed-on: https://swiftshader-review.googlesource.com/5182
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
src/OpenGL/compiler/preprocessor/DirectiveParser.cpp
src/OpenGL/compiler/preprocessor/MacroExpander.cpp
src/OpenGL/compiler/preprocessor/MacroExpander.h
src/OpenGL/compiler/preprocessor/Preprocessor.cpp