diff options
Diffstat (limited to 'lib/ProfileData/InstrProfWriter.cpp')
-rw-r--r-- | lib/ProfileData/InstrProfWriter.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/ProfileData/InstrProfWriter.cpp b/lib/ProfileData/InstrProfWriter.cpp index ce3f8806e12e..18b9deec158f 100644 --- a/lib/ProfileData/InstrProfWriter.cpp +++ b/lib/ProfileData/InstrProfWriter.cpp @@ -48,9 +48,10 @@ namespace llvm { // back patching. class ProfOStream { public: - ProfOStream(raw_fd_ostream &FD) : IsFDOStream(true), OS(FD), LE(FD) {} + ProfOStream(raw_fd_ostream &FD) + : IsFDOStream(true), OS(FD), LE(FD, support::little) {} ProfOStream(raw_string_ostream &STR) - : IsFDOStream(false), OS(STR), LE(STR) {} + : IsFDOStream(false), OS(STR), LE(STR, support::little) {} uint64_t tell() { return OS.tell(); } void write(uint64_t V) { LE.write<uint64_t>(V); } @@ -85,7 +86,7 @@ public: // true. Otherwise, \c OS will be an raw_string_ostream. bool IsFDOStream; raw_ostream &OS; - support::endian::Writer<support::little> LE; + support::endian::Writer LE; }; class InstrProfRecordWriterTrait { @@ -112,7 +113,7 @@ public: EmitKeyDataLength(raw_ostream &Out, key_type_ref K, data_type_ref V) { using namespace support; - endian::Writer<little> LE(Out); + endian::Writer LE(Out, little); offset_type N = K.size(); LE.write<offset_type>(N); @@ -139,7 +140,7 @@ public: void EmitData(raw_ostream &Out, key_type_ref, data_type_ref V, offset_type) { using namespace support; - endian::Writer<little> LE(Out); + endian::Writer LE(Out, little); for (const auto &ProfileData : *V) { const InstrProfRecord &ProfRecord = ProfileData.second; SummaryBuilder->addRecord(ProfRecord); @@ -361,7 +362,8 @@ void InstrProfWriter::writeRecordInText(StringRef Name, uint64_t Hash, std::unique_ptr<InstrProfValueData[]> VD = Func.getValueForSite(VK, S); for (uint32_t I = 0; I < ND; I++) { if (VK == IPVK_IndirectCallTarget) - OS << Symtab.getFuncName(VD[I].Value) << ":" << VD[I].Count << "\n"; + OS << Symtab.getFuncNameOrExternalSymbol(VD[I].Value) << ":" + << VD[I].Count << "\n"; else OS << VD[I].Value << ":" << VD[I].Count << "\n"; } @@ -379,7 +381,6 @@ Error InstrProfWriter::writeText(raw_fd_ostream &OS) { if (shouldEncodeData(I.getValue())) if (Error E = Symtab.addFuncName(I.getKey())) return E; - Symtab.finalizeSymtab(); for (const auto &I : FunctionData) if (shouldEncodeData(I.getValue())) |