diff options
-rw-r--r-- | llvm/include/llvm/ProfileData/SampleProf.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/include/llvm/ProfileData/SampleProf.h b/llvm/include/llvm/ProfileData/SampleProf.h index 5103751da35..5221540c63d 100644 --- a/llvm/include/llvm/ProfileData/SampleProf.h +++ b/llvm/include/llvm/ProfileData/SampleProf.h @@ -97,6 +97,8 @@ static inline uint64_t SPMagic(SampleProfileFormat Format = SPF_Raw_Binary) { 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; } |