uint8_t optLevel; /* optimization level (0 to 3) */
uint8_t dbgFlags;
+ bool omitLineNum; /* only used for printing the prog when dbgFlags is set */
struct {
int16_t maxGPR; /* may be -1 if none used */
class PrintPass : public Pass
{
public:
- PrintPass() : serial(0) { }
+ PrintPass(bool omitLineNum) : serial(0), omit_serial(omitLineNum) { }
virtual bool visit(Function *);
virtual bool visit(BasicBlock *);
private:
int serial;
+ bool omit_serial;
};
bool
bool
PrintPass::visit(Instruction *insn)
{
- INFO("%3i: ", serial++);
+ if (omit_serial)
+ INFO(" ");
+ else
+ INFO("%3i: ", serial);
+ serial++;
insn->print();
return true;
}
void
Function::print()
{
- PrintPass pass;
+ PrintPass pass(prog->driver->omitLineNum);
pass.run(this, true, false);
}
void
Program::print()
{
- PrintPass pass;
+ PrintPass pass(driver->omitLineNum);
init_colours();
pass.run(this, true, false);
}
info.optLevel = debug_get_num_option("NV50_PROG_OPTIMIZE", 3);
info.dbgFlags = debug_get_num_option("NV50_PROG_DEBUG", 0);
+ info.omitLineNum = debug_get_num_option("NV50_PROG_DEBUG_OMIT_LINENUM", 0);
ret = nv50_ir_generate_code(&info);
if (ret) {
#ifdef DEBUG
info->optLevel = debug_get_num_option("NV50_PROG_OPTIMIZE", 3);
info->dbgFlags = debug_get_num_option("NV50_PROG_DEBUG", 0);
+ info->omitLineNum = debug_get_num_option("NV50_PROG_DEBUG_OMIT_LINENUM", 0);
#else
info->optLevel = 3;
#endif
info->target = debug_get_num_option("NV50_PROG_CHIPSET", chipset);
info->optLevel = debug_get_num_option("NV50_PROG_OPTIMIZE", 3);
info->dbgFlags = debug_get_num_option("NV50_PROG_DEBUG", 0);
+ info->omitLineNum = debug_get_num_option("NV50_PROG_DEBUG_OMIT_LINENUM", 0);
#else
info->optLevel = 3;
#endif