aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/sb/sb_ra_checker.cpp
diff options
context:
space:
mode:
authorVadim Girlin <[email protected]>2013-05-14 17:08:38 +0400
committerVadim Girlin <[email protected]>2013-05-14 17:36:25 +0400
commitecde4b07e2208934a17a09d26c43baf314c10a60 (patch)
treeecab4397e3d8d6d2e01f328a1b3bdc52fce61acf /src/gallium/drivers/r600/sb/sb_ra_checker.cpp
parent57d1be0d2d195dac0e08585b6cd098779f7a7bd7 (diff)
r600g/sb: get rid of standard c++ streams
Static initialization of internal libstdc++ data related to iostream causes segfaults with some apps. This patch replaces all uses of std::ostream and std::ostringstream in sb with custom lightweight classes. Prevents segfaults with ut2004demo and probably some other old apps. Signed-off-by: Vadim Girlin <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/sb/sb_ra_checker.cpp')
-rw-r--r--src/gallium/drivers/r600/sb/sb_ra_checker.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/gallium/drivers/r600/sb/sb_ra_checker.cpp b/src/gallium/drivers/r600/sb/sb_ra_checker.cpp
index 83510b02158..9681e69f6cd 100644
--- a/src/gallium/drivers/r600/sb/sb_ra_checker.cpp
+++ b/src/gallium/drivers/r600/sb/sb_ra_checker.cpp
@@ -24,15 +24,11 @@
* Vadim Girlin
*/
-#include <sstream>
-
#include "sb_shader.h"
#include "sb_pass.h"
namespace r600_sb {
-using std::cerr;
-
int ra_checker::run() {
rm_stack.clear();
@@ -54,11 +50,11 @@ int ra_checker::run() {
void ra_checker::dump_error(const error_info &e) {
- cerr << "error at : ";
+ sblog << "error at : ";
dump::dump_op(e.n);
- cerr << "\n";
- cerr << " : " << e.message << "\n";
+ sblog << "\n";
+ sblog << " : " << e.message << "\n";
}
void ra_checker::dump_all_errors() {
@@ -96,20 +92,20 @@ void ra_checker::kill_alu_only_regs() {
void ra_checker::check_value_gpr(node *n, unsigned id, value *v) {
sel_chan gpr = v->gpr;
if (!gpr) {
- std::ostringstream o;
+ sb_ostringstream o;
o << "operand value " << *v << " is not allocated";
error(n, id, o.str());
return;
}
reg_value_map::iterator F = rmap().find(v->gpr);
if (F == rmap().end()) {
- std::ostringstream o;
+ sb_ostringstream o;
o << "operand value " << *v << " was not previously written to its gpr";
error(n, id, o.str());
return;
}
if (!F->second->v_equal(v)) {
- std::ostringstream o;
+ sb_ostringstream o;
o << "expected operand value " << *v
<< ", gpr contains " << *(F->second);
error(n, id, o.str());
@@ -128,7 +124,7 @@ void ra_checker::check_src_vec(node *n, unsigned id, vvec &vv, bool src) {
if (v->is_rel()) {
if (!v->rel) {
- std::ostringstream o;
+ sb_ostringstream o;
o << "expected relative offset in " << *v;
error(n, id, o.str());
return;
@@ -159,7 +155,7 @@ void ra_checker::process_op_dst(node *n) {
if (v->is_sgpr()) {
if (!v->gpr) {
- std::ostringstream o;
+ sb_ostringstream o;
o << "destination operand " << *v << " is not allocated";
error(n, id, o.str());
return;
@@ -201,7 +197,7 @@ void ra_checker::check_alu_group(alu_group_node *g) {
for (node_iterator I = g->begin(), E = g->end(); I != E; ++I) {
node *a = *I;
if (!a->is_alu_inst()) {
- std::ostringstream o;
+ sb_ostringstream o;
o << "non-alu node inside alu group";
error(a, 0, o.str());
return;