Index: lib/CodeGen/TargetLoweringObjectFileImpl.cpp =================================================================== --- lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -294,6 +294,13 @@ Name = getSectionPrefixForGlobal(Kind); } + // TODO: update when API is available to check if a function is hot. + if (const Function *F = dyn_cast(GV)) { + if (F->getEntryCount()) { + Name += ".hot"; + } + } + if (EmitUniqueSection && UniqueSectionNames) { Name.push_back('.'); TM.getNameWithPrefix(Name, GV, Mang, true);