From 8dd4ca819b941237802f361b37614fe91742f0a7 Mon Sep 17 00:00:00 2001 From: Xinliang David Li Date: Mon, 11 Apr 2016 17:13:08 +0000 Subject: [PATCH] Add code comment/NFC llvm-svn: 265966 --- llvm/lib/ProfileData/InstrProf.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/llvm/lib/ProfileData/InstrProf.cpp b/llvm/lib/ProfileData/InstrProf.cpp index 7e043e3..7f4a87a 100644 --- a/llvm/lib/ProfileData/InstrProf.cpp +++ b/llvm/lib/ProfileData/InstrProf.cpp @@ -398,6 +398,10 @@ uint64_t InstrProfRecord::remapValue(uint64_t Value, uint32_t ValueKind, std::lower_bound(ValueMap->begin(), ValueMap->end(), Value, [](const std::pair &LHS, uint64_t RHS) { return LHS.first < RHS; }); + // Raw function pointer collected by value profiler may be from + // external functions that are not instrumented. They won't have + // mapping data to be used by the deserializer. Force the value to + // be 0 in this case. if (Result != ValueMap->end() && Result->first == Value) Value = (uint64_t)Result->second; else -- 2.7.4