summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ProfileData
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/ProfileData')
-rw-r--r--llvm/lib/ProfileData/InstrProf.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/ProfileData/InstrProf.cpp b/llvm/lib/ProfileData/InstrProf.cpp
index 1be3df4699c..8514b44777e 100644
--- a/llvm/lib/ProfileData/InstrProf.cpp
+++ b/llvm/lib/ProfileData/InstrProf.cpp
@@ -606,11 +606,12 @@ void annotateValueSite(Module &M, Instruction &Inst,
std::unique_ptr<InstrProfValueData[]> VD =
InstrProfR.getValueForSite(ValueKind, SiteIdx, &Sum);
- annotateValueSite(M, Inst, VD.get(), NV, Sum, ValueKind, MaxMDCount);
+ ArrayRef<InstrProfValueData> VDs(VD.get(), NV);
+ annotateValueSite(M, Inst, VDs, Sum, ValueKind, MaxMDCount);
}
void annotateValueSite(Module &M, Instruction &Inst,
- const InstrProfValueData VD[], uint32_t NV,
+ ArrayRef<InstrProfValueData> VDs,
uint64_t Sum, InstrProfValueKind ValueKind,
uint32_t MaxMDCount) {
LLVMContext &Ctx = M.getContext();
@@ -627,11 +628,11 @@ void annotateValueSite(Module &M, Instruction &Inst,
// Value Profile Data
uint32_t MDCount = MaxMDCount;
- for (uint32_t I = 0; I < NV; ++I) {
+ for (auto &VD : VDs) {
Vals.push_back(MDHelper.createConstant(
- ConstantInt::get(Type::getInt64Ty(Ctx), VD[I].Value)));
+ ConstantInt::get(Type::getInt64Ty(Ctx), VD.Value)));
Vals.push_back(MDHelper.createConstant(
- ConstantInt::get(Type::getInt64Ty(Ctx), VD[I].Count)));
+ ConstantInt::get(Type::getInt64Ty(Ctx), VD.Count)));
if (--MDCount == 0)
break;
}
OpenPOWER on IntegriCloud