[llvm] r334455 - Fix a buildbot error reported by sanitizer-x86_64-linux-fast:
Wei Mi via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 11 16:39:02 PDT 2018
Author: wmi
Date: Mon Jun 11 16:39:02 2018
New Revision: 334455
URL: http://llvm.org/viewvc/llvm-project?rev=334455&view=rev
Log:
Fix a buildbot error reported by sanitizer-x86_64-linux-fast:
Function::getGUID may complain if its input is an empty StringRef.
Modified:
llvm/trunk/include/llvm/ProfileData/SampleProf.h
Modified: llvm/trunk/include/llvm/ProfileData/SampleProf.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ProfileData/SampleProf.h?rev=334455&r1=334454&r2=334455&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ProfileData/SampleProf.h (original)
+++ llvm/trunk/include/llvm/ProfileData/SampleProf.h Mon Jun 11 16:39:02 2018
@@ -97,6 +97,8 @@ static inline uint64_t SPMagic(SamplePro
static inline StringRef getRepInFormat(StringRef Name,
SampleProfileFormat Format,
std::string &GUIDBuf) {
+ if (Name.empty())
+ return Name;
GUIDBuf = std::to_string(Function::getGUID(Name));
return (Format == SPF_Compact_Binary) ? StringRef(GUIDBuf) : Name;
}
More information about the llvm-commits
mailing list