Avoid printing to stdout directly in library functions.
authorLei Zhang <antiagainst@google.com>
Mon, 2 May 2016 22:11:54 +0000 (18:11 -0400)
committerLei Zhang <antiagainst@google.com>
Thu, 5 May 2016 14:15:06 +0000 (10:15 -0400)
commit09caf12beca6a9bfc11f2140c8fec62ed4c7e95b
tree86e26a5f389ef0133e1bac8f32569fd93a0bbe93
parent97f4e0fe1959f1d72332a6cd1cf5edff8d653136
Avoid printing to stdout directly in library functions.

Previously GlslangToSpv() reported missing/TBD functionalities
by directly writing to stdout using printf. That could cause
problems to callers of GlslangToSpv(). This patch cleans up
the error reporting logic in GlslangToSpv(), TGlslangToSpvTraverser,
and spv::Builder a little bit to use ostringstream.

Also fixed the usage of GlslangToSpv() in GTest fixtures to
capture warnings/errors reported when translating AST to SPIR-V.
SPIRV/GlslangToSpv.cpp
SPIRV/GlslangToSpv.h
SPIRV/SpvBuilder.cpp
SPIRV/SpvBuilder.h
StandAlone/StandAlone.cpp
gtests/TestFixture.h