mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-12-20 03:17:48 +00:00
Tidy comments in SampleProfile header. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237197 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -59,7 +59,7 @@ static inline uint64_t SPMagic() {
|
|||||||
|
|
||||||
static inline uint64_t SPVersion() { return 100; }
|
static inline uint64_t SPVersion() { return 100; }
|
||||||
|
|
||||||
/// \brief Represents the relative location of an instruction.
|
/// Represents the relative location of an instruction.
|
||||||
///
|
///
|
||||||
/// Instruction locations are specified by the line offset from the
|
/// Instruction locations are specified by the line offset from the
|
||||||
/// beginning of the function (marked by the line where the function
|
/// beginning of the function (marked by the line where the function
|
||||||
@@ -100,7 +100,7 @@ template <> struct DenseMapInfo<sampleprof::LineLocation> {
|
|||||||
|
|
||||||
namespace sampleprof {
|
namespace sampleprof {
|
||||||
|
|
||||||
/// \brief Representation of a single sample record.
|
/// Representation of a single sample record.
|
||||||
///
|
///
|
||||||
/// A sample record is represented by a positive integer value, which
|
/// A sample record is represented by a positive integer value, which
|
||||||
/// indicates how frequently was the associated line location executed.
|
/// indicates how frequently was the associated line location executed.
|
||||||
@@ -116,7 +116,7 @@ public:
|
|||||||
|
|
||||||
SampleRecord() : NumSamples(0), CallTargets() {}
|
SampleRecord() : NumSamples(0), CallTargets() {}
|
||||||
|
|
||||||
/// \brief Increment the number of samples for this record by \p S.
|
/// Increment the number of samples for this record by \p S.
|
||||||
///
|
///
|
||||||
/// Sample counts accumulate using saturating arithmetic, to avoid wrapping
|
/// Sample counts accumulate using saturating arithmetic, to avoid wrapping
|
||||||
/// around unsigned integers.
|
/// around unsigned integers.
|
||||||
@@ -127,7 +127,7 @@ public:
|
|||||||
NumSamples = std::numeric_limits<unsigned>::max();
|
NumSamples = std::numeric_limits<unsigned>::max();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// \brief Add called function \p F with samples \p S.
|
/// Add called function \p F with samples \p S.
|
||||||
///
|
///
|
||||||
/// Sample counts accumulate using saturating arithmetic, to avoid wrapping
|
/// Sample counts accumulate using saturating arithmetic, to avoid wrapping
|
||||||
/// around unsigned integers.
|
/// around unsigned integers.
|
||||||
@@ -139,13 +139,13 @@ public:
|
|||||||
TargetSamples = std::numeric_limits<unsigned>::max();
|
TargetSamples = std::numeric_limits<unsigned>::max();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// \brief Return true if this sample record contains function calls.
|
/// Return true if this sample record contains function calls.
|
||||||
bool hasCalls() const { return CallTargets.size() > 0; }
|
bool hasCalls() const { return CallTargets.size() > 0; }
|
||||||
|
|
||||||
unsigned getSamples() const { return NumSamples; }
|
unsigned getSamples() const { return NumSamples; }
|
||||||
const CallTargetMap &getCallTargets() const { return CallTargets; }
|
const CallTargetMap &getCallTargets() const { return CallTargets; }
|
||||||
|
|
||||||
/// \brief Merge the samples in \p Other into this record.
|
/// Merge the samples in \p Other into this record.
|
||||||
void merge(const SampleRecord &Other) {
|
void merge(const SampleRecord &Other) {
|
||||||
addSamples(Other.getSamples());
|
addSamples(Other.getSamples());
|
||||||
for (const auto &I : Other.getCallTargets())
|
for (const auto &I : Other.getCallTargets())
|
||||||
@@ -159,7 +159,7 @@ private:
|
|||||||
|
|
||||||
typedef DenseMap<LineLocation, SampleRecord> BodySampleMap;
|
typedef DenseMap<LineLocation, SampleRecord> BodySampleMap;
|
||||||
|
|
||||||
/// \brief Representation of the samples collected for a function.
|
/// Representation of the samples collected for a function.
|
||||||
///
|
///
|
||||||
/// This data structure contains all the collected samples for the body
|
/// This data structure contains all the collected samples for the body
|
||||||
/// of a function. Each sample corresponds to a LineLocation instance
|
/// of a function. Each sample corresponds to a LineLocation instance
|
||||||
@@ -187,13 +187,13 @@ public:
|
|||||||
Num);
|
Num);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// \brief Return the sample record at the given location.
|
/// Return the sample record at the given location.
|
||||||
/// Each location is specified by \p LineOffset and \p Discriminator.
|
/// Each location is specified by \p LineOffset and \p Discriminator.
|
||||||
SampleRecord &sampleRecordAt(const LineLocation &Loc) {
|
SampleRecord &sampleRecordAt(const LineLocation &Loc) {
|
||||||
return BodySamples[Loc];
|
return BodySamples[Loc];
|
||||||
}
|
}
|
||||||
|
|
||||||
/// \brief Return the number of samples collected at the given location.
|
/// Return the number of samples collected at the given location.
|
||||||
/// Each location is specified by \p LineOffset and \p Discriminator.
|
/// Each location is specified by \p LineOffset and \p Discriminator.
|
||||||
unsigned samplesAt(int LineOffset, unsigned Discriminator) {
|
unsigned samplesAt(int LineOffset, unsigned Discriminator) {
|
||||||
return sampleRecordAt(LineLocation(LineOffset, Discriminator)).getSamples();
|
return sampleRecordAt(LineLocation(LineOffset, Discriminator)).getSamples();
|
||||||
@@ -201,17 +201,17 @@ public:
|
|||||||
|
|
||||||
bool empty() const { return BodySamples.empty(); }
|
bool empty() const { return BodySamples.empty(); }
|
||||||
|
|
||||||
/// \brief Return the total number of samples collected inside the function.
|
/// Return the total number of samples collected inside the function.
|
||||||
unsigned getTotalSamples() const { return TotalSamples; }
|
unsigned getTotalSamples() const { return TotalSamples; }
|
||||||
|
|
||||||
/// \brief Return the total number of samples collected at the head of the
|
/// Return the total number of samples collected at the head of the
|
||||||
/// function.
|
/// function.
|
||||||
unsigned getHeadSamples() const { return TotalHeadSamples; }
|
unsigned getHeadSamples() const { return TotalHeadSamples; }
|
||||||
|
|
||||||
/// \brief Return all the samples collected in the body of the function.
|
/// Return all the samples collected in the body of the function.
|
||||||
const BodySampleMap &getBodySamples() const { return BodySamples; }
|
const BodySampleMap &getBodySamples() const { return BodySamples; }
|
||||||
|
|
||||||
/// \brief Merge the samples in \p Other into this one.
|
/// Merge the samples in \p Other into this one.
|
||||||
void merge(const FunctionSamples &Other) {
|
void merge(const FunctionSamples &Other) {
|
||||||
addTotalSamples(Other.getTotalSamples());
|
addTotalSamples(Other.getTotalSamples());
|
||||||
addHeadSamples(Other.getHeadSamples());
|
addHeadSamples(Other.getHeadSamples());
|
||||||
@@ -223,16 +223,18 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// \brief Total number of samples collected inside this function.
|
/// Total number of samples collected inside this function.
|
||||||
///
|
///
|
||||||
/// Samples are cumulative, they include all the samples collected
|
/// Samples are cumulative, they include all the samples collected
|
||||||
/// inside this function and all its inlined callees.
|
/// inside this function and all its inlined callees.
|
||||||
unsigned TotalSamples;
|
unsigned TotalSamples;
|
||||||
|
|
||||||
/// \brief Total number of samples collected at the head of the function.
|
/// Total number of samples collected at the head of the function.
|
||||||
|
/// This is an approximation of the number of calls made to this function
|
||||||
|
/// at runtime.
|
||||||
unsigned TotalHeadSamples;
|
unsigned TotalHeadSamples;
|
||||||
|
|
||||||
/// \brief Map instruction locations to collected samples.
|
/// Map instruction locations to collected samples.
|
||||||
///
|
///
|
||||||
/// Each entry in this map contains the number of samples
|
/// Each entry in this map contains the number of samples
|
||||||
/// collected at the corresponding line offset. All line locations
|
/// collected at the corresponding line offset. All line locations
|
||||||
|
|||||||
Reference in New Issue
Block a user