mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-17 18:24:34 +00:00
InstrProf: When reading, copy the data instead of taking a reference. NFC
This consolidates the logic to read instrprof records into the on disk hash table's lookup trait and makes us copy the counter data instead of taking references to it as we read. This will simplify further changes to the format. Patch by Betul Buyukkurt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240206 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -16,7 +16,9 @@
|
||||
#ifndef LLVM_PROFILEDATA_INSTRPROF_H_
|
||||
#define LLVM_PROFILEDATA_INSTRPROF_H_
|
||||
|
||||
#include "llvm/ADT/StringRef.h"
|
||||
#include <system_error>
|
||||
#include <vector>
|
||||
|
||||
namespace llvm {
|
||||
const std::error_category &instrprof_category();
|
||||
@@ -41,6 +43,16 @@ inline std::error_code make_error_code(instrprof_error E) {
|
||||
return std::error_code(static_cast<int>(E), instrprof_category());
|
||||
}
|
||||
|
||||
/// Profiling information for a single function.
|
||||
struct InstrProfRecord {
|
||||
InstrProfRecord() {}
|
||||
InstrProfRecord(StringRef Name, uint64_t Hash, std::vector<uint64_t> &Counts)
|
||||
: Name(Name), Hash(Hash), Counts(std::move(Counts)) {}
|
||||
StringRef Name;
|
||||
uint64_t Hash;
|
||||
std::vector<uint64_t> Counts;
|
||||
};
|
||||
|
||||
} // end namespace llvm
|
||||
|
||||
namespace std {
|
||||
|
Reference in New Issue
Block a user