mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 12:12:47 +01:00
[llvm] Populate std::vector at construction time (NFC)
This commit is contained in:
parent
a6f855d31d
commit
56ec2fba1e
@ -63,8 +63,7 @@ static Error writeVariableSizedInteger(uint64_t Integer, size_t Size,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void ZeroFillBytes(raw_ostream &OS, size_t Size) {
|
static void ZeroFillBytes(raw_ostream &OS, size_t Size) {
|
||||||
std::vector<uint8_t> FillData;
|
std::vector<uint8_t> FillData(Size, 0);
|
||||||
FillData.insert(FillData.begin(), Size, 0);
|
|
||||||
OS.write(reinterpret_cast<char *>(FillData.data()), Size);
|
OS.write(reinterpret_cast<char *>(FillData.data()), Size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,14 +199,12 @@ size_t writeLoadCommandData<MachO::build_version_command>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ZeroFillBytes(raw_ostream &OS, size_t Size) {
|
void ZeroFillBytes(raw_ostream &OS, size_t Size) {
|
||||||
std::vector<uint8_t> FillData;
|
std::vector<uint8_t> FillData(Size, 0);
|
||||||
FillData.insert(FillData.begin(), Size, 0);
|
|
||||||
OS.write(reinterpret_cast<char *>(FillData.data()), Size);
|
OS.write(reinterpret_cast<char *>(FillData.data()), Size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Fill(raw_ostream &OS, size_t Size, uint32_t Data) {
|
void Fill(raw_ostream &OS, size_t Size, uint32_t Data) {
|
||||||
std::vector<uint32_t> FillData;
|
std::vector<uint32_t> FillData((Size / 4) + 1, Data);
|
||||||
FillData.insert(FillData.begin(), (Size / 4) + 1, Data);
|
|
||||||
OS.write(reinterpret_cast<char *>(FillData.data()), Size);
|
OS.write(reinterpret_cast<char *>(FillData.data()), Size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -287,8 +287,7 @@ std::error_code ProfileSymbolList::read(const uint8_t *Data,
|
|||||||
std::error_code ProfileSymbolList::write(raw_ostream &OS) {
|
std::error_code ProfileSymbolList::write(raw_ostream &OS) {
|
||||||
// Sort the symbols before output. If doing compression.
|
// Sort the symbols before output. If doing compression.
|
||||||
// It will make the compression much more effective.
|
// It will make the compression much more effective.
|
||||||
std::vector<StringRef> SortedList;
|
std::vector<StringRef> SortedList(Syms.begin(), Syms.end());
|
||||||
SortedList.insert(SortedList.begin(), Syms.begin(), Syms.end());
|
|
||||||
llvm::sort(SortedList);
|
llvm::sort(SortedList);
|
||||||
|
|
||||||
std::string OutputString;
|
std::string OutputString;
|
||||||
@ -303,8 +302,7 @@ std::error_code ProfileSymbolList::write(raw_ostream &OS) {
|
|||||||
|
|
||||||
void ProfileSymbolList::dump(raw_ostream &OS) const {
|
void ProfileSymbolList::dump(raw_ostream &OS) const {
|
||||||
OS << "======== Dump profile symbol list ========\n";
|
OS << "======== Dump profile symbol list ========\n";
|
||||||
std::vector<StringRef> SortedList;
|
std::vector<StringRef> SortedList(Syms.begin(), Syms.end());
|
||||||
SortedList.insert(SortedList.begin(), Syms.begin(), Syms.end());
|
|
||||||
llvm::sort(SortedList);
|
llvm::sort(SortedList);
|
||||||
|
|
||||||
for (auto &Sym : SortedList)
|
for (auto &Sym : SortedList)
|
||||||
|
Loading…
Reference in New Issue
Block a user