llvm.org GIT mirror llvm / daa7fe4
[TableGen] Print #nnn as a name of an non-native reg unit with id nnn When using -debug with -gen-register-info, tablegen will crash when trying to print a name of a non-native register unit. This patch only affects the debug information generated while running llvm-tblgen, and has no impact on the compilable code coming out of it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298875 91177308-0d34-0410-b5e6-96231b3b80d8 Krzysztof Parzyszek 3 years ago
2 changed file(s) with 17 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
16671667 dbgs() << "UnitSet " << USIdx << " " << RegUnitSets[USIdx].Name
16681668 << ":";
16691669 for (auto &U : RegUnitSets[USIdx].Units)
1670 dbgs() << " " << RegUnits[U].Roots[0]->getName();
1670 printRegUnitName(U);
16711671 dbgs() << "\n";
16721672 });
16731673
16801680 dbgs() << "UnitSet " << USIdx << " " << RegUnitSets[USIdx].Name
16811681 << ":";
16821682 for (auto &U : RegUnitSets[USIdx].Units)
1683 dbgs() << " " << RegUnits[U].Roots[0]->getName();
1683 printRegUnitName(U);
16841684 dbgs() << "\n";
16851685 }
16861686 dbgs() << "\nUnion sets:\n");
17261726 DEBUG(dbgs() << "UnitSet " << RegUnitSets.size()-1
17271727 << " " << RegUnitSets.back().Name << ":";
17281728 for (auto &U : RegUnitSets.back().Units)
1729 dbgs() << " " << RegUnits[U].Roots[0]->getName();
1729 printRegUnitName(U);
17301730 dbgs() << "\n";);
17311731 }
17321732 }
17411741 dbgs() << "UnitSet " << USIdx << " " << RegUnitSets[USIdx].Name
17421742 << ":";
17431743 for (auto &U : RegUnitSets[USIdx].Units)
1744 dbgs() << " " << RegUnits[U].Roots[0]->getName();
1744 printRegUnitName(U);
17451745 dbgs() << "\n";
17461746 });
17471747
17621762 continue;
17631763
17641764 DEBUG(dbgs() << "RC " << RC.getName() << " Units: \n";
1765 for (auto &U : RCRegUnits)
1766 dbgs() << RegUnits[U].getRoots()[0]->getName() << " ";
1765 for (auto U : RCRegUnits)
1766 printRegUnitName(U);
17671767 dbgs() << "\n UnitSetIDs:");
17681768
17691769 // Find all supersets.
21692169 BV.set(Set[i]->EnumValue);
21702170 return BV;
21712171 }
2172
2173 void CodeGenRegBank::printRegUnitName(unsigned Unit) const {
2174 if (Unit < NumNativeRegUnits)
2175 dbgs() << ' ' << RegUnits[Unit].Roots[0]->getName();
2176 else
2177 dbgs() << " #" << Unit;
2178 }
734734 // LaneMask is contained in CoveringLanes will be completely covered by
735735 // another sub-register with the same or larger lane mask.
736736 LaneBitmask CoveringLanes;
737
738 // Helper function for printing debug information. Handles artificial
739 // (non-native) reg units.
740 void printRegUnitName(unsigned Unit) const;
737741 };
738742
739743 } // end namespace llvm