------------------------------------------------------------------------------ Helper functions - implementation ------------------------------------------------------------------------------
| 125 | // Helper functions - implementation |
| 126 | //------------------------------------------------------------------------------ |
| 127 | static void printOpcodeCounterResult(raw_ostream &OutS, |
| 128 | const ResultOpcodeCounter &OpcodeMap) { |
| 129 | OutS << "=================================================" |
| 130 | << "\n"; |
| 131 | OutS << "LLVM-TUTOR: OpcodeCounter results\n"; |
| 132 | OutS << "=================================================\n"; |
| 133 | const char *str1 = "OPCODE"; |
| 134 | const char *str2 = "#TIMES USED"; |
| 135 | OutS << format("%-20s %-10s\n", str1, str2); |
| 136 | OutS << "-------------------------------------------------" |
| 137 | << "\n"; |
| 138 | for (auto &Inst : OpcodeMap) { |
| 139 | OutS << format("%-20s %-10lu\n", Inst.first().str().c_str(), |
| 140 | Inst.second); |
| 141 | } |
| 142 | OutS << "-------------------------------------------------" |
| 143 | << "\n\n"; |
| 144 | } |