bool OutputSpecification(TIntermSpecification* node, TIntermTraverser* it) { TOutputTraverser* oit = static_cast<TOutputTraverser*>(it); TInfoSink& out = oit->infoSink; OutputExtensionText(out, node); OutputTreeText(out, node, oit->depth); TType* t = node->getType(); out.debug << "specify '" << t->getTypeName().c_str() << "' (" << t->getCompleteString() << ")\n"; return true; #if 0 TTypeList* tl = t->getStruct(); TTypeList::iterator iter = tl->begin(); for(; iter < tl->end(); iter++) { out.debug << FormatSourceRange(iter->line); for (i = 0; i < (oit->depth+1); ++i) out.debug << " "; out.debug << "'" << iter->type->getFieldName().c_str() << "' (" << iter->type->getCompleteString().c_str() << ")\n"; } #endif }
bool ast_debugvar_traverser_visitor::enter(class ast_function_definition* node) { copyScopeTo(node); const char* name = node->prototype->identifier; std::string range = FormatSourceRange(node->get_location()); // FIXME: function without prototype VPRINT(3, "%c%sbegin function signature %s at %s %c%s\n", ESC_CHAR, ESC_BOLD, name, range.c_str(), ESC_CHAR, ESC_RESET); // Save & restore global scope ScopeSaver ss(&scope); depth++; this->visit(&node->prototype->parameters); if (node->body) node->body->accept(this); depth--; VPRINT(3, "%c%send function signature %s at %s %c%s\n", ESC_CHAR, ESC_BOLD, name, range.c_str(), ESC_CHAR, ESC_RESET); return false; }
static void OutputChangeableText(TInfoSink &infoSink, TIntermNode* node, const int depth, bool param) { ShChangeableList *cgbl; int i, j; if (!node) return; if (!param && !(cgbl = node->getCgbList())) return; if (!param && !cgbl->numChangeables) return; if (param && !(node->getAsAggregate())) return; if (param && !(cgbl = node->getAsAggregate()->getCgbParameterList())) return; if (param && !cgbl->numChangeables) return; infoSink.debug << FormatSourceRange(node->getRange()); for (i = 0; i < depth; ++i) infoSink.debug << " "; if (param) { infoSink.debug << " └──prm──› "; } else { infoSink.debug << " └──cgb──› "; } for (i=0; i<cgbl->numChangeables; i++) { ShChangeable *cgb; if ((cgb = cgbl->changeables[i])) { infoSink.debug << cgb->id; for (j=0; j<cgb->numIndices; j++) { ShChangeableIndex *idx; if ((idx = cgb->indices[j])) { switch (idx->type) { case SH_CGB_ARRAY_DIRECT: infoSink.debug << "[" << idx->index << "]"; break; case SH_CGB_ARRAY_INDIRECT: infoSink.debug << "[(" << idx->index << ")]"; break; case SH_CGB_STRUCT: infoSink.debug << "." << idx->index; break; case SH_CGB_SWIZZLE: infoSink.debug << "," << idx->index; break; default: dbgPrint(DBGLVL_ERROR, "unknown index type\n!"); break; } } } infoSink.debug << " "; } } infoSink.debug << "\n"; }
void OutputTreeText(TInfoSink& infoSink, TIntermNode* node, const int depth) { int i; infoSink.debug << FormatSourceRange(node->getRange()); infoSink.debug << " *" << node->hasNoSideEffects(); infoSink.debug << "*" << node->containsEmitVertex(); infoSink.debug << "*" << node->containsDiscard() << "*"; for (i = 0; i < depth; ++i) infoSink.debug << " "; }
void OutputExtensionText(TInfoSink& infoSink, TIntermNode* node) { TExtensionList extMap; TExtensionList::iterator iter; extMap = node->getCPPExtensionList(); for (iter = extMap.begin(); iter != extMap.end(); iter++) { infoSink.debug << FormatSourceRange(node->getRange()); infoSink.debug << " CPP extension "; infoSink.debug << iter->first; infoSink.debug << " changed to "; infoSink.debug << iter->second; infoSink.debug << "\n"; } }
static void OutputScopeText(TInfoSink& infoSink, TIntermNode* node, const int depth) { int i; scopeList *scope = node->getScope(); infoSink.debug << FormatSourceRange(node->getRange()); for (i = 0; i < depth; ++i) infoSink.debug << " "; if (scope) { scopeList::iterator li = scope->begin(); infoSink.debug << " └─scope─› "; while (li != scope->end()) { infoSink.debug << *li << " "; li++; } infoSink.debug << "\n"; } else { infoSink.debug << " └─scope─› (NULL)\n"; } }